/* ============================================
   BRIQUE PRO — DESIGN SYSTEM
   ============================================ */

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    background-color: #0B0F19;
    background-image:
        radial-gradient(at 0% 0%, rgba(107, 33, 168, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.10) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ============================================
   AURORA BACKGROUND
   ============================================ */
.aurora-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: aurora-float 20s ease-in-out infinite;
}

.aurora-blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #A855F7 0%, transparent 70%);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.aurora-blob-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #06B6D4 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
    animation-delay: -8s;
}

.aurora-blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #6B21A8 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: -14s;
}

@keyframes aurora-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(60px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-40px, 70px) scale(0.95);
    }
}

/* ============================================
   GLASS / GLASSMORPHISM
   ============================================ */
.glass-card {
    background: rgba(30, 27, 75, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color .3s, transform .3s, box-shadow .3s;
}

.glass-card:hover {
    border-color: rgba(168, 85, 247, 0.18);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.95rem;
    border-radius: 0.85rem;
    color: rgb(148 163 184);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all .2s;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: rgba(168, 85, 247, 0.06);
    color: rgb(226 232 240);
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(6, 182, 212, 0.10));
    border: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.18) inset;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 3px;
    background: linear-gradient(180deg, #A855F7, #06B6D4);
    border-radius: 0 4px 4px 0;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.55rem 0.25rem;
    border-radius: 0.85rem;
    color: rgb(148 163 184);
    font-size: 0.65rem;
    font-weight: 600;
    transition: all .25s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mobile-nav.active {
    color: white;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(6, 182, 212, 0.10));
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.mobile-nav.active svg {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.7));
}

/* ============================================
   PERIOD FILTER PILLS
   ============================================ */
.period-btn {
    padding: 0.45rem 0.95rem;
    border-radius: 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgb(148 163 184);
    transition: all .2s;
    white-space: nowrap;
}

.period-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.04);
}

.period-btn.active {
    background: linear-gradient(135deg, #A855F7, #6B21A8);
    color: white;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.45);
}

/* ============================================
   KPI CARDS
   ============================================ */
.kpi-card {
    background: rgba(30, 27, 75, 0.35);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.1rem;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    transition: transform .3s, border-color .3s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.25);
}

.kpi-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 100% 0%, rgba(168, 85, 247, 0.18) 0%, transparent 50%);
    opacity: 0;
    transition: opacity .4s;
    pointer-events: none;
}

.kpi-card:hover .kpi-glow {
    opacity: 1;
}

.kpi-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    margin-top: 0.25rem;
    line-height: 1.2;
}

@media (min-width: 1024px) {
    .kpi-value { font-size: 1.55rem; }
}

/* ============================================
   FORMS
   ============================================ */
.input,
input[type="text"].input,
input[type="number"].input,
input[type="url"].input,
input[type="date"].input,
input[type="datetime-local"].input,
select.input,
textarea.input {
    width: 100%;
    background: rgba(11, 15, 25, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.8rem;
    padding: 0.7rem 0.9rem;
    color: white;
    font-size: 0.9rem;
    transition: all .2s;
    font-family: inherit;
}

.input:focus,
input.input:focus,
select.input:focus,
textarea.input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
    background: rgba(11, 15, 25, 0.85);
}

.input::placeholder { color: rgb(100 116 139); }

input[type="date"].input::-webkit-calendar-picker-indicator,
input[type="datetime-local"].input::-webkit-calendar-picker-indicator {
    filter: invert(0.7) sepia(1) hue-rotate(220deg) saturate(2);
    cursor: pointer;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A855F7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.label-input {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgb(148 163 184);
    margin-bottom: 0.4rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    background: linear-gradient(135deg, #A855F7 0%, #6B21A8 100%);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.35), 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all .2s;
    border: 1px solid rgba(168, 85, 247, 0.45);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.55), 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.btn-cyan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    background: linear-gradient(135deg, #06B6D4 0%, #0E7490 100%);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.35), 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all .2s;
    border: 1px solid rgba(6, 182, 212, 0.45);
    white-space: nowrap;
}

.btn-cyan:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(6, 182, 212, 0.55); }

.btn-emerald {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
    transition: all .2s;
    white-space: nowrap;
}

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

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    border-radius: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: rgb(226 232 240);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all .2s;
    white-space: nowrap;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(168, 85, 247, 0.3);
    color: white;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    background: linear-gradient(135deg, #F43F5E 0%, #9F1239 100%);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.30);
    transition: all .2s;
    border: 1px solid rgba(244, 63, 94, 0.45);
    white-space: nowrap;
}

.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(244, 63, 94, 0.5); }

/* ============================================
   RESULT PILLS (CALCULATORS)
   ============================================ */
.result-pill {
    border-radius: 0.9rem;
    padding: 0.85rem;
    border: 1px solid;
    text-align: center;
}

.result-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgb(148 163 184);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.result-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge::before {
    content: '';
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.status-maintenance { background: rgba(251, 146, 60, 0.12); color: #fb923c; }
.status-announced { background: rgba(168, 85, 247, 0.12); color: #A855F7; }
.status-sold { background: rgba(16, 185, 129, 0.12); color: #10B981; }
.status-returned { background: rgba(244, 63, 94, 0.12); color: #F43F5E; }

/* ============================================
   TAG CHIPS
   ============================================ */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(168, 85, 247, 0.10);
    color: #C4B5FD;
    border: 1px solid rgba(168, 85, 247, 0.20);
    transition: all .15s;
}

.tag-chip.removable {
    cursor: pointer;
}

.tag-chip.removable:hover {
    background: rgba(244, 63, 94, 0.15);
    color: #FCA5A5;
    border-color: rgba(244, 63, 94, 0.25);
}

.tag-chip.filter-active {
    background: linear-gradient(135deg, #A855F7, #6B21A8);
    color: white;
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* ============================================
   CHARTS
   ============================================ */
.chart-wrap {
    position: relative;
    height: 280px;
}

.chart-wrap-square {
    position: relative;
    height: 280px;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .chart-wrap { height: 300px; }
}

/* ============================================
   INVENTORY TABLE
   ============================================ */
#inv-table-body tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background .15s;
}

#inv-table-body tr:hover {
    background: rgba(168, 85, 247, 0.04);
}

#inv-table-body td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.item-thumb {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
}

.item-thumb-empty {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(6, 182, 212, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(148 163 184);
    flex-shrink: 0;
}

.icon-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgb(203 213 225);
    transition: all .15s;
}

.icon-btn:hover {
    background: rgba(168, 85, 247, 0.12);
    color: white;
    border-color: rgba(168, 85, 247, 0.3);
}

.icon-btn.icon-btn-sell:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border-color: rgba(16, 185, 129, 0.4);
}

.icon-btn.icon-btn-danger:hover {
    background: rgba(244, 63, 94, 0.15);
    color: #F43F5E;
    border-color: rgba(244, 63, 94, 0.4);
}

/* ============================================
   MOBILE INVENTORY CARD
   ============================================ */
.inv-card {
    background: rgba(30, 27, 75, 0.35);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.1rem;
    padding: 1rem;
    transition: all .25s;
}

.inv-card.expanded {
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.inv-card-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, margin-top .25s, padding-top .25s;
    margin-top: 0;
}

.inv-card.expanded .inv-card-expand {
    max-height: 700px;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================
   MODAL SYSTEM
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

@media (min-width: 1024px) {
    .modal { align-items: center; padding: 2rem; }
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn .25s;
}

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 36rem;
    max-height: 92vh;
    max-height: 92dvh;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.95), rgba(11, 15, 25, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 1.2rem 1.2rem 0 0;
    box-shadow: 0 -10px 60px rgba(168, 85, 247, 0.18);
    display: flex;
    flex-direction: column;
    animation: slideUp .3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1024px) {
    .modal-panel {
        border-radius: 1.2rem;
        animation: scaleIn .3s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

.modal-panel-sm { max-width: 28rem; }
.modal-panel-xs { max-width: 22rem; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.modal-body {
    padding: 1.2rem 1.3rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.modal-footer {
    display: flex;
    gap: 0.6rem;
    padding: 1rem 1.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(11, 15, 25, 0.6);
    flex-shrink: 0;
}

.modal-close {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    color: rgb(148 163 184);
    transition: all .15s;
}

.modal-close:hover {
    background: rgba(244, 63, 94, 0.12);
    color: #F43F5E;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes scaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============================================
   EXTRA COST ROW (MODAL)
   ============================================ */
.extra-cost-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.extra-cost-row input {
    flex: 1;
}

.extra-cost-row .btn-remove {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.7rem;
    background: rgba(244, 63, 94, 0.10);
    color: #F43F5E;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.extra-cost-row .btn-remove:hover {
    background: rgba(244, 63, 94, 0.20);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    pointer-events: auto;
    min-width: 260px;
    max-width: 360px;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.95), rgba(11, 15, 25, 0.95));
    backdrop-filter: blur(14px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(168, 85, 247, 0.15);
    color: white;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    animation: toastIn .35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(16, 185, 129, 0.18); }
.toast.toast-error   { border-color: rgba(244, 63, 94, 0.4);  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(244, 63, 94, 0.18); }
.toast.toast-info    { border-color: rgba(6, 182, 212, 0.4);  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(6, 182, 212, 0.18); }

.toast.toast-leaving {
    animation: toastOut .25s forwards;
}

@keyframes toastIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    to { transform: translateX(120%); opacity: 0; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.25);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(168, 85, 247, 0.4); }

/* ============================================
   UTILITIES
   ============================================ */
.view { animation: viewIn .35s ease; }

@keyframes viewIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.3), transparent);
    margin: 1rem 0;
}

.shimmer {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.05) 0%, rgba(168, 85, 247, 0.15) 50%, rgba(168, 85, 247, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hide arrows from number inputs */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* Print friendly */
@media print {
    .aurora-bg, #sidebar, header, nav { display: none !important; }
}

/* Focus visible */
button:focus-visible,
a:focus-visible {
    outline: 2px solid rgba(168, 85, 247, 0.6);
    outline-offset: 2px;
}

/* ============================================
   AUTH / LANDING / PRICING (SaaS additions)
   ============================================ */

.auth-view {
    animation: viewIn .35s ease;
}

.gradient-text {
    background: linear-gradient(135deg, #A855F7 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* Feature cards (landing) */
.feature-card {
    background: rgba(30, 27, 75, 0.35);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.2rem;
    padding: 1.5rem;
    transition: all .3s;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.12);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pricing cards */
.pricing-card {
    background: rgba(30, 27, 75, 0.35);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.3rem;
    padding: 2rem 1.6rem;
    position: relative;
    transition: all .3s;
}

.pricing-card:hover {
    transform: translateY(-3px);
}

.pricing-highlight {
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.18), 0 12px 30px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.06), rgba(6, 182, 212, 0.03));
}

.pricing-current {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.12);
}

.ribbon {
    position: absolute;
    top: -10px;
    right: 1.5rem;
    background: linear-gradient(135deg, #A855F7, #6B21A8);
    color: white;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.45);
}

.ribbon-current {
    background: linear-gradient(135deg, #10B981, #047857);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    right: auto;
    left: 1.5rem;
}

/* Testimonial cards */
.testimonial-card {
    background: rgba(30, 27, 75, 0.35);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.2rem;
    padding: 1.5rem;
    transition: all .3s;
}

.testimonial-card:hover {
    border-color: rgba(168, 85, 247, 0.2);
}

/* Billing cycle toggle */
.cycle-btn {
    padding: 0.5rem 1.1rem;
    border-radius: 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgb(148 163 184);
    transition: all .2s;
    white-space: nowrap;
}

.cycle-btn:hover { color: white; }

.cycle-btn.active {
    background: linear-gradient(135deg, #A855F7, #6B21A8);
    color: white;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

/* Password visibility toggle */
.toggle-pwd {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(148 163 184);
    padding: 0.3rem;
    border-radius: 0.4rem;
    transition: color .15s;
}

.toggle-pwd:hover { color: white; }

/* Strength meter */
.strength-meter .strength-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
}

.strength-meter .strength-bars span {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: all .2s;
}

/* Checkbox */
.checkbox {
    appearance: none;
    width: 1rem;
    height: 1rem;
    border-radius: 0.3rem;
    background: rgba(11, 15, 25, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all .15s;
}

.checkbox:checked {
    background: linear-gradient(135deg, #A855F7, #6B21A8);
    border-color: #A855F7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* User menu (sidebar) */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all .2s;
}

.user-menu:hover {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.2);
}

/* Loader spin */
.loader-spin {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin-right: 0.4rem;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Locked feature overlay */
.locked-overlay {
    position: relative;
}

.locked-overlay::before {
    content: '🔒 Faça upgrade para Pro';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(4px);
    color: #A855F7;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: inherit;
    z-index: 5;
    pointer-events: none;
}

/* Hide scroll for inline pills row */
@media (max-width: 1023px) {
    #period-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        max-width: 100%;
        scrollbar-width: none;
    }
    #period-filter::-webkit-scrollbar { display: none; }
}

/* ============================================
   AI CHAT WIDGET (BriqueBot)
   ============================================ */

.ai-chat-fab {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 50;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #A855F7 0%, #6B21A8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.55), 0 8px 20px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

@media (max-width: 1023px) {
    .ai-chat-fab {
        bottom: 5.5rem; /* acima do bottom-nav mobile */
        left: 1rem;
        width: 3.25rem;
        height: 3.25rem;
    }
}

.ai-chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.75), 0 12px 28px rgba(0, 0, 0, 0.4);
}

.ai-chat-fab.hidden-fab {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
    pointer-events: none;
}

.ai-chat-fab-icon { position: relative; z-index: 2; }

.ai-chat-fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.4);
    animation: aiPulse 2.4s infinite;
}

@keyframes aiPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

.ai-chat-fab-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(11, 15, 25, 0.95);
    color: white;
    padding: 0.5rem 0.85rem;
    border-radius: 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.ai-chat-fab:hover .ai-chat-fab-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
}

@media (max-width: 1023px) {
    .ai-chat-fab-tooltip { display: none; }
}

.ai-chat-panel {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 51;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 580px;
    max-height: calc(100vh - 3rem);
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.97), rgba(11, 15, 25, 0.97));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 1.3rem;
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.25), 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.92);
    opacity: 0;
    pointer-events: none;
    transition: all .35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@media (max-width: 1023px) {
    .ai-chat-panel {
        bottom: 4.5rem;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        height: 70vh;
    }
}

.ai-chat-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.08), transparent);
    flex-shrink: 0;
}

.ai-chat-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    background: linear-gradient(135deg, #A855F7, #6B21A8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

.ai-chat-rate {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.7rem;
    color: rgb(148 163 184);
    background: rgba(168, 85, 247, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ai-chat-rate-blocked {
    background: rgba(244, 63, 94, 0.1);
    color: #FCA5A5;
}

.ai-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ai-msg {
    display: flex;
    max-width: 88%;
    animation: aiMsgIn .25s ease;
}

@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg-user { align-self: flex-end; }
.ai-msg-bot { align-self: flex-start; }

.ai-msg-bubble {
    padding: 0.65rem 0.9rem;
    border-radius: 1.1rem;
    font-size: 0.875rem;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.ai-msg-user .ai-msg-bubble {
    background: linear-gradient(135deg, #A855F7, #6B21A8);
    color: white;
    border-bottom-right-radius: 0.3rem;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.ai-msg-bot .ai-msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    color: rgb(241 245 249);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 0.3rem;
}

.ai-msg-bubble code {
    background: rgba(168, 85, 247, 0.15);
    color: #C4B5FD;
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
    font-size: 0.82em;
    font-family: 'Courier New', monospace;
}

.ai-typing {
    display: flex;
    gap: 0.3rem;
    padding: 0.2rem 0;
}

.ai-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #A855F7;
    animation: aiTypingBounce 1.2s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.30s; }

@keyframes aiTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.ai-chat-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    padding: 0 0.9rem 0.6rem;
    flex-shrink: 0;
}

.ai-suggestion {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.7rem;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.18);
    color: rgb(226 232 240);
    font-size: 0.72rem;
    font-weight: 500;
    text-align: left;
    transition: all .15s;
    cursor: pointer;
}

.ai-suggestion:hover {
    background: rgba(168, 85, 247, 0.16);
    border-color: rgba(168, 85, 247, 0.35);
    transform: translateY(-1px);
}

.ai-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(11, 15, 25, 0.5);
    flex-shrink: 0;
}

#ai-chat-input {
    flex: 1;
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.6rem 0.85rem;
    color: white;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all .15s;
}

#ai-chat-input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.ai-chat-send {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #A855F7, #6B21A8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
    transition: all .15s;
    flex-shrink: 0;
}

.ai-chat-send:hover { transform: translateY(-1px); }
.ai-chat-send:active { transform: translateY(0) scale(0.95); }

/* ============================================
   COMMAND PALETTE
   ============================================ */
.cmdk-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    padding-left: 1rem;
    padding-right: 1rem;
    animation: fadeIn .2s;
}

.cmdk-panel {
    width: 100%;
    max-width: 36rem;
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.97), rgba(11, 15, 25, 0.97));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 1.1rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(168, 85, 247, 0.15);
    overflow: hidden;
    animation: scaleIn .25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmdk-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cmdk-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.cmdk-input::placeholder { color: rgb(100 116 139); }

.cmdk-kbd {
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    color: rgb(148 163 184);
    font-size: 0.65rem;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-width: 2px;
}

.cmdk-list {
    max-height: 50vh;
    overflow-y: auto;
    padding: 0.4rem;
}

.cmdk-section-title {
    padding: 0.5rem 0.9rem 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgb(100 116 139);
}

.cmdk-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    color: rgb(226 232 240);
    cursor: pointer;
    transition: background .12s;
    font-size: 0.88rem;
}

.cmdk-item:hover,
.cmdk-item.active {
    background: rgba(168, 85, 247, 0.15);
}

.cmdk-item-icon {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 0.5rem;
    background: rgba(168, 85, 247, 0.12);
    color: #A855F7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cmdk-item-hint {
    margin-left: auto;
    font-size: 0.7rem;
    color: rgb(100 116 139);
}

/* ============================================
   ONBOARDING TOUR
   ============================================ */
.tour-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

.tour-highlight {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75), 0 0 40px rgba(168, 85, 247, 0.45);
    pointer-events: none;
    transition: all .4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid rgba(168, 85, 247, 0.6);
}

.tour-tooltip {
    position: absolute;
    z-index: 81;
    width: 320px;
    max-width: calc(100vw - 2rem);
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.97), rgba(11, 15, 25, 0.97));
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 1.1rem;
    padding: 1.2rem;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.25), 0 16px 40px rgba(0, 0, 0, 0.45);
    transition: all .4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-step-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #A855F7;
    margin-bottom: 0.5rem;
}

.tour-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   PLAN LOCK BADGE
   ============================================ */
.plan-lock {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(107, 33, 168, 0.12));
    color: #C4B5FD;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ============================================
   GOALS / METAS
   ============================================ */
.goal-card {
    background: rgba(30, 27, 75, 0.35);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.1rem;
    padding: 1.1rem;
    position: relative;
    overflow: hidden;
}

.goal-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.8rem;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #A855F7, #06B6D4);
    border-radius: 999px;
    transition: width .6s cubic-bezier(0.16, 1, 0.3, 1);
}

.goal-progress-fill.complete {
    background: linear-gradient(90deg, #10B981, #06B6D4);
}

/* ============================================
   BULK ACTION BAR
   ============================================ */
.bulk-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 40;
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.97), rgba(11, 15, 25, 0.97));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 1.1rem;
    padding: 0.7rem 1.1rem;
    box-shadow: 0 -8px 30px rgba(168, 85, 247, 0.2), 0 12px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bulk-bar.show {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 1023px) {
    .bulk-bar {
        bottom: 5rem;
        max-width: calc(100vw - 1.5rem);
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ============================================
   HELP / FAQ FAB (bottom-right)
   ============================================ */
.help-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 49;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.85), rgba(14, 116, 144, 0.85));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
    transition: all .25s;
}

@media (max-width: 1023px) {
    .help-fab {
        bottom: 5.5rem;
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
    }
}

.help-fab:hover { transform: scale(1.1); }

/* ============================================
   ML SEARCH MODAL
   ============================================ */
.ml-result {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all .15s;
}

.ml-result:hover {
    background: rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.2);
}

.ml-result img {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

/* ============================================
   LEGAL MODAL (Termos / Privacidade)
   ============================================ */
.modal-legal-panel {
    max-width: 42rem;
    width: 100%;
}

.modal-legal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.legal-content h2 {
    color: white;
    line-height: 1.2;
}
.legal-content h3 {
    line-height: 1.3;
}
.legal-content p {
    color: rgb(203 213 225);
    line-height: 1.7;
    margin-bottom: 0.8rem;
    font-size: 0.92rem;
}
.legal-content ul {
    color: rgb(203 213 225);
    line-height: 1.65;
    font-size: 0.9rem;
}
.legal-content ul li {
    margin-bottom: 0.3rem;
}
.legal-content strong {
    color: white;
    font-weight: 600;
}
.legal-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.legal-content a:hover {
    text-decoration-style: wavy;
}

/* ============================================
   NOTIFICATIONS DROPDOWN
   ============================================ */
.notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F43F5E;
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
    border: 1.5px solid #0B0F19;
}
