:root {
    /* Paleta Altycel Premium Dark */
    --bg-body: #050505;
    --bg-sidebar: #0d0d0d;
    --bg-card: #141414;

    --text-primary: #f5f5f7;
    --text-secondary: #86868b;

    --accent: #22c55e;
    --accent-hover: #16a34a;
    --accent-glow: rgba(34, 197, 94, 0.2);

    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.6);
    --bg-darker: #020617;
    --card-hover: rgba(16, 185, 129, 0.05);

    --radius: 16px;
    --radius-btn: 12px;

    /* Effects */
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: blur(12px);
}

/* --- Global Elegant Scrollbar (Altycel Premium) --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 197, 94, 0.5);
}

::-webkit-scrollbar-track {
    background: transparent;
}

.global-pause-control {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 10px;
    border-radius: 20px;
    margin-right: 10px;
    border: 1px solid var(--border);
}

/* Mini Switch */
.switch-sm {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

.switch-sm input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-sm {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 20px;
}

.slider-sm:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider-sm {
    background-color: var(--danger);
}

input:checked+.slider-sm:before {
    transform: translateX(16px);
}

/* ðŸŒ“ Light Theme Overrides */
body.light-theme {
    --bg-body: #f5f5f7;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #1d1d1f;
    --text-secondary: #86868b;

    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.1);
    --bg-darker: #f0f0f2;
    --card-hover: rgba(0, 255, 115, 0.03);

    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.06);
}

body.light-theme .topbar {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body.light-theme .system-name {
    background: linear-gradient(90deg, #1d1d1f, #86868b);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-theme .search-bar-top input {
    background: #f0f0f2;
    color: #1d1d1f;
}

body.light-theme input,
body.light-theme select,
body.light-theme textarea {
    background: #f9f9fb;
    color: #1d1d1f;
}

body.light-theme tr {
    background: #ffffff;
}

body.light-theme tr:hover {
    background: #f9f9fb;
}

body.light-theme .stat-card p {
    background: linear-gradient(180deg, #1d1d1f, #555);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

/* Elegant 'Visible' Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    /* Sutil mas visÃ­vel */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Print Area Hiding (Global) */
.print-only,
.print-label-only {
    display: none !important;
}

/* TABS LOGIC */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* STATS CARDS - COMPACT & UNIFORM */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--accent-glow), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card h3 {
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    font-weight: 600;
}

.stat-card p {
    margin: 8px 0 0;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(180deg, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card small {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.finance-summary .stat-card {
    padding: 25px 15px;
}

/* SIDEBAR & LAYOUT */
/* --- TOPBAR & NAVBAR MODERN DESIGN --- */

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 14px;
    letter-spacing: 0.5px;
    line-height: 1.6;
    font-weight: 400;
    zoom: 0.85;
}

input,
select,
textarea,
button {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* TOPBAR (Header) */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-area img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.system-name {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Search Bar Top */
.search-bar-top input {
    background: #0a0a0a;
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 20px;
    color: #fff;
    width: 300px;
    transition: all 0.3s ease;
}

.search-bar-top input:focus {
    width: 400px;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(50, 215, 75, 0.2);
}

/* User Actions */
.user-actions {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    color: var(--text-secondary);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.text-danger {
    color: var(--danger) !important;
}

/* NAVBAR GRID (Menu abaixo do Topbar) */
/* APP LAYOUT STRUCTURE */
.app-layout {
    display: flex;
    margin-top: 64px;
    /* Space for fixed topbar */
    height: calc(100vh - 64px);
    overflow: hidden;
}

/* SIDEBAR NAV */
.sidebar-nav {
    width: 250px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    overflow-y: auto;
    /* Adicionado rolagem */
    flex-shrink: 0;
    margin: 15px;
    margin-left: -300px;
    /* Hide to the left initially */
    opacity: 0;
    /* Fade it out for sleekness */
    height: calc(100vh - 94px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    z-index: 990;
}

.sidebar-nav.open {
    margin-left: 15px;
    opacity: 1;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    font-family: inherit;
    border-right: 3px solid transparent;
}

.nav-item .icon {
    font-size: 20px;
    filter: grayscale(100%) opacity(0.6);
}

.nav-item .label {
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(34, 197, 94, 0.08);
    /* Glow suave */
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.nav-item.active .icon {
    filter: grayscale(0%) opacity(1);
}

/* MAIN CONTENT AREA */
.main-content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 35px;
    background: var(--bg-body);
}

/* Fix Home Tech Container scale */
.home-tech-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    min-height: 100%;
    /* Fill the scrollable main area */
    align-items: center;
}

/* RESPONSIVE ADJUSTMENTS */
@media screen and (max-width: 768px) {
    .topbar {
        padding: 0 15px;
    }

    .search-bar-top {
        display: none;
        /* Hide search on mobile */
    }

    .system-name {
        display: none;
        /* Hide name on mobile if logo present */
    }

    .navbar-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 cols on mobile */
        padding: 0 15px;
        gap: 10px;
    }

    .nav-card {
        padding: 10px;
    }

    .nav-card .icon {
        font-size: 20px;
    }

    .nav-card .label {
        font-size: 10px;
    }

    .main-content {
        padding: 0 15px 15px 15px;
    }

    .stats-container {
        grid-template-columns: 1fr 1fr !important;
    }

    .card {
        grid-column: span 2 !important;
    }

    /* TABLE TO CARD TRANSFORMATION */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        background: var(--bg-card);
        margin-bottom: 15px;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        padding: 10px;
    }

    td {
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        position: relative;
        padding-left: 45% !important;
        text-align: right;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    td:last-child {
        border-bottom: 0;
        justify-content: center;
        padding-left: 15px !important;
        flex-wrap: wrap;
        gap: 10px;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 40%;
        text-align: left;
        font-weight: bold;
        color: var(--text-secondary);
        font-size: 11px;
        text-transform: uppercase;
    }

    /* Buttons & Inputs full width on mobile */
    .btn,
    .btn-primary {
        width: 100%;
        margin-bottom: 10px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }

    .header div {
        width: 100%;
    }

    .modal-content div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .modal-content,
    .modal-overlay .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Tablet & Desktop: 769px+ -> TOP NAVIGATION */
@media screen and (min-width: 769px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        left: 0;
        transform: none !important;
        /* Reset mobile transform */
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 30px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        background-color: var(--bg-sidebar);
    }

    .logo img {
        width: 40px;
        margin-bottom: 0;
        border-radius: 8px;
    }

    nav {
        flex-direction: row;
        gap: 20px;
    }

    .nav-btn {
        padding: 8px 15px;
        font-size: 14px;
        margin-bottom: 0;
        /* Reset margin */
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 30px 50px;
        max-width: 1600px;
        margin: 0 auto;
    }

    .stats-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop Large: above 1440px */
@media screen and (min-width: 1441px) {
    .stats-container {
        gap: 30px;
    }
}

/* Global fluidity */
img {
    max-width: 100%;
    height: auto;
}

input,
select,
textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/* --- OTHER STYLES (RESTORED) --- */
.logo img {
    width: 60px;
    border-radius: 12px;
    margin-bottom: 30px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 15px;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-btn);
    transition: all 0.2s;
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-btn);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #00cc5c);
    color: #000;
    padding: 12px 25px;
    border-radius: var(--radius-btn);
    border: none;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.btn-sm:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* PadronizaÃƒÂ§ÃƒÂ£o de BotÃƒÂµes de Termos */
.btn-fixed {
    width: 130px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11px !important;
    line-height: 1.2;
    padding: 5px !important;
    border-radius: 10px !important;
}

.footer-actions {
    padding-top: 15px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

th {
    text-align: left;
    padding: 15px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background-color: transparent;
}

tr {
    background: var(--bg-card);
    transition: all 0.3s;
}

td {
    padding: 16px;
    font-size: 14px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

td:first-child {
    border-left: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
}

td:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) 0;
}

tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.product-row img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.product-row img:hover {
    transform: scale(1.1);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(0, 113, 227, 0.1);
}

.full-tab-content {
    display: none;
}

.full-tab-content.active {
    display: block;
}

.modal-overlay .modal-content {
    margin: auto;
    max-width: 900px;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(16px);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    background: #121212;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

/* Bot Management 2.0 - New Styles */
.health-monitor {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.health-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: transform 0.2s;
}

.health-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.health-val {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent);
}

.health-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.monitor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 20px;
}

.chat-monitor-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.chat-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.chat-card:hover {
    border-color: var(--accent);
    background: var(--card-hover);
}

.chat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
}

.chat-name {
    font-weight: bold;
    font-size: 14px;
}

.chat-msg {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-online {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.btn-takeover {
    background: var(--danger);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    border: none;
}

.btn-release {
    background: var(--accent);
    color: #000;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    border: none;
    font-weight: bold;
}

option {
    background: #121212;
    color: #fff;
}

input:focus {
    border-color: var(--accent);
    outline: none;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-aberta {
    background: #333;
    color: #fff;
}

.badge-analise {
    background: #0071E3;
    color: #fff;
}

.badge-aprovada {
    background: #BF5AF2;
    color: #fff;
}

.badge-pronta {
    background: var(--success);
    color: #000;
}

.badge-finalizada {
    background: #555;
    color: #fff;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a1a1b;
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-footer {
    padding: 20px;
    background: #181818;
    border-top: 1px solid var(--border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 15px;
}

.cart-bump {
    animation: cartBump 0.4s ease;
}

@keyframes cartBump {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1E1E1E;
    border: 1px solid #333;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: var(--accent);
    color: #fff;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item div {
    font-size: 11px;
    opacity: 0.7;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.product-card.Samsung {
    border-left: 4px solid #0071E3;
}

.product-card.Motorola {
    border-left: 4px solid #FF9F0A;
}

.product-card.Apple {
    border-left: 4px solid #888;
}

.product-card.Xiaomi {
    border-left: 4px solid #FF4500;
}

.brand-tag {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.product-card h3 {
    font-size: 16px;
    margin: 5px 0 10px;
    color: #fff;
}

.price-tag {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 15px;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
}

.swatch {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    border-radius: 20px;
}

.swatch-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.swatch span {
    font-size: 10px;
    font-weight: bold;
    color: var(--text-secondary);
}

.swatch.out-of-stock {
    opacity: 0.4;
    text-decoration: line-through;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

#modal-os .modal-content,
#modal-produto .modal-content,
#modal-pagamento .modal-content,
#modal-checkout .modal-content,
#modal-capinha .modal-content {
    overflow-y: auto;
    display: block;
    height: auto;
    max-height: 95vh;
}

/* ==========================================
   ðŸ”” NOTIFICATION & BADGE PREMIUM STYLES
   ========================================== */

#btn-notif.new-notif {
    animation: bellShake 0.5s infinite;
    color: var(--warning) !important;
    text-shadow: 0 0 10px var(--warning);
}

@keyframes bellShake {
    0% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(15deg);
    }

    30% {
        transform: rotate(-15deg);
    }

    45% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(5deg);
    }

    85% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(0);
    }
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge.aprovada {
    background: var(--success);
    color: #000;
}

.badge.aberta {
    background: var(--warning);
    color: #000;
}

.badge.lixeira {
    background: var(--danger);
    color: #fff;
}

/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    animation: fadeIn 0.4s ease-out;
}

.debt-alert {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff4444;
    padding: 10px;
    border-radius: 8px;
    color: #ff6666;
    font-weight: bold;
    margin-bottom: 15px;
    display: none;
    align-items: center;
    gap: 10px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

#table-historico th,
#table-historico td {
    border-bottom: 1px solid #333;
    padding: 10px;
    text-align: left;
}

#table-historico .status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}

.name-container:hover {
    background: rgba(0, 113, 227, 0.1);
    cursor: pointer;
    border-radius: 4px;
}

/* --- HOME TECH (DETOX) --- */
.home-tech-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    min-height: calc(100vh - 220px);
    align-items: center;
    padding: 0 40px 40px 40px;
    animation: fadeIn 0.8s ease-out;
}

.home-main-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tech-logo-wrapper {
    position: relative;
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.logo-large-central {
    width: 350px;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    z-index: 10;
    /* Removed background, borders and shadows */
    background: transparent;
    border: none;
    box-shadow: none;
}

.tech-orbit {
    position: absolute;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 50%;
    animation: rotateOrbit 10s linear infinite;
}

.tech-orbit-1 {
    width: 240px;
    height: 240px;
    border-top: 2px solid var(--accent);
}

.tech-orbit-2 {
    width: 270px;
    height: 270px;
    border-bottom: 2px solid var(--accent);
    animation-duration: 15s;
    animation-direction: reverse;
}

.tech-scan-line {
    position: absolute;
    width: 260px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    z-index: 11;
    top: 50%;
    animation: scanLine 4s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes rotateOrbit {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes scanLine {

    0%,
    100% {
        top: 20%;
        opacity: 0;
    }

    50% {
        top: 80%;
        opacity: 1;
    }
}

.system-welcome-text {
    margin-top: 40px;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(to bottom, #fff, #999);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.system-status-text {
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.status-online {
    color: var(--accent);
    font-weight: bold;
    text-shadow: 0 0 10px var(--accent-glow);
}

.widget-glass {
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.home-widgets-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.home-widgets-section .card-modern {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 15px;
    box-shadow: var(--shadow-sm);
}

.clock-widget {
    text-align: right;
    display: flex;
    flex-direction: column;
}

#home-digital-clock {
    font-size: 32px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    color: #fff;
    line-height: 1;
}

#home-digital-date {
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.calendar-widget {
    font-size: 12px;
}

.calendar-header {
    margin-bottom: 15px;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    color: var(--text-secondary);
    font-weight: bold;
    margin-bottom: 10px;
}

.calendar-grid-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day,
.calendar-day-empty {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: default;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
}

.calendar-day.today {
    background: var(--accent);
    color: #000;
    font-weight: bold;
    box-shadow: 0 0 15px var(--accent-glow);
}

@media screen and (max-width: 1100px) {
    .home-tech-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 60px;
    }

    .home-widgets-section {
        flex-direction: row;
        justify-content: center;
    }
}

@media screen and (max-width: 768px) {
    .home-widgets-section {
        flex-direction: column;
    }

    .tech-logo-wrapper {
        width: 250px;
        height: 250px;
    }

    .logo-large-central {
        width: 160px;
        height: 160px;
    }

    .system-welcome-text {
        font-size: 20px;
    }
}

/* --- MÓDULO ORÇAMENTOS --- */
.orcamentos-module {
    animation: fadeIn 0.5s ease-out;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.supplier-config {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calculator-container {
    padding: 30px;
    margin-bottom: 30px;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: flex-start;
}

.result-group {
    background: rgba(34, 197, 94, 0.1);
    padding: 15px;
    border-radius: 12px;
    border: 1px dashed var(--accent);
    text-align: center;
}

.price-badge {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    margin-top: 5px;
}

.calc-footer {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
}

.price-text {
    color: var(--accent);
    font-weight: bold;
}

.orc-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

@media screen and (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .supplier-config {
        width: 100%;
    }

    .supplier-config input {
        flex-grow: 1;
    }
}

/* --- Sugestões Autocomplete PDF --- */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 1000;
    max-height: 450px;
    /* Aumentado de 200px p/ 450px */
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    margin-top: 5px;
}

.suggestion-item {
    padding: 16px 20px;
    /* Mais preenchimento para facilitar o clique */
    font-size: 15px;
    /* Fonte maior */
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent);
}

.suggestion-price {
    font-weight: bold;
    color: var(--accent);
    font-size: 16px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 600;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(34, 197, 94, 0.05);
}

/* --- CARRINHO LATERAL (CART SIDEBAR) --- */
.cart-sidebar {
    position: fixed;
    top: 64px;
    right: -400px;
    width: 350px;
    height: calc(100vh - 64px);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--accent);
}

#toast-container {
    zoom: 1.17;
    /* Compensa o zoom 0.85 do body */
}

/* --- AUTOCOMPLETE CHECKOUT --- */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 2000;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
}

.autocomplete-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.autocomplete-item strong {
    color: var(--accent);
    display: block;
}

.autocomplete-item small {
    color: var(--text-secondary);
}

/* Badges Lista de Clientes */
.name-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    max-width: 250px;
    /* Evita que a coluna de nome cresça demais horizontalmente */
}

.badge-type {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 4px;
    letter-spacing: 1px;
}

.badge-loja {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-bot {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.zap-name {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alty-name {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.2;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    border: 1px solid var(--border);
    display: inline-block;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-cliente-loja:hover {
    background: rgba(34, 197, 94, 0.03) !important;
}

.row-cliente-bot:hover {
    background: rgba(59, 130, 246, 0.03) !important;
}

/* --- Melhorias Dashboard Clientes --- */
.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 113, 227, 0.2);
}

.search-box {
    position: relative;
}

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.6;
}

.name-container img {
    transition: transform 0.3s ease;
}

.name-container:hover img {
    transform: scale(1.1);
}

.alty-name {
    display: block;
    margin-top: 2px;
}