:root {
    --navy: var(--bg-main);
    --navy-light: var(--bg-surface);
    --orange: var(--color-primary);
    --orange-hover: var(--color-primary-hover);
    --slate: var(--bg-main);
    --silver: var(--text-muted);
    --white: var(--text-main);
    --glass: var(--glass-bg);
    --transition: var(--transition-base);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--slate);
    color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, .brand {
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Glassmorphism Cards */
.card {
    background: linear-gradient(135deg, var(--navy-light) 0%, rgba(10, 25, 47, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 40px -20px rgba(2, 12, 27, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, transparent, var(--orange), transparent);
    opacity: 0.3;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 107, 0, 0.3);
    box-shadow: 0 30px 60px -25px rgba(2, 12, 27, 0.9);
}

.card:hover::before {
    opacity: 1;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--orange);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--orange-hover);
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--orange);
    color: var(--orange);
}

.btn-outline:hover {
    background: rgba(255, 107, 0, 0.1);
}

/* Inputs & Form Controls */
.input {
    width: 100%;
    background: rgba(10, 25, 47, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--white);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.input:focus {
    border-color: var(--orange);
    background: rgba(10, 25, 47, 0.8);
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.2);
}

.input::placeholder {
    color: var(--silver);
    opacity: 0.4;
}

.form-group {
    margin-bottom: 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: var(--navy);
    padding: 40px 20px;
    position: sticky;
    top: 0;
    border-right: 1px solid var(--glass);
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
}

.sidebar-header img {
    filter: drop-shadow(0 0 10px rgba(230, 126, 34, 0.2));
    transition: transform 0.3s ease;
}

.sidebar-header img:hover {
    transform: scale(1.02);
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--orange);
}

.nav-link.active {
    background: rgba(230, 126, 34, 0.1);
    color: var(--orange);
    font-weight: 700;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    text-align: left;
    color: var(--orange);
    padding: 16px;
    border-bottom: 1px solid var(--glass);
    font-size: 0.9rem;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--glass);
    color: var(--silver);
}

tr:hover td {
    background-color: var(--glass);
}

/* Status Badges */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Quote Status Badges */
.badge-draft { background: rgba(226, 232, 240, 0.1); color: var(--silver); }
.badge-sent { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.badge-approved { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.badge-completed { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.badge-superseded { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* Product Category Badges */
.badge-cftv { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.badge-rede { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.badge-automação { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.badge-infraestrutura { background: rgba(226, 232, 240, 0.1); color: var(--silver); }

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

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Glassmorphism Sidebar Effect */
.sidebar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--orange), transparent);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.form-group label {
    display: block;
    color: var(--silver);
    opacity: 0.7;
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Print Styles */
@media print {
    .sidebar, .btn, .nav-link, a[href="/quotes"] {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    main {
        padding: 0 !important;
    }

    .card {
        background: white !important;
        border: 1px solid #eee !important;
        box-shadow: none !important;
        color: black !important;
        backdrop-filter: none !important;
    }

    h1, h2, h3, th, td {
        color: black !important;
    }

    table th {
        background: #f5f5f5 !important;
        border-bottom: 2px solid black !important;
    }

    table td {
        border-bottom: 1px solid #eee !important;
    }

    .badge {
        border: 1px solid black !important;
        background: transparent !important;
        color: black !important;
    }

    .layout {
        display: block !important;
    }
}

.ui-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 24px 0 12px;
}

.ui-divider::before,
.ui-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ui-divider:not(:empty)::before {
    margin-right: .75em;
}

.ui-divider:not(:empty)::after {
    margin-left: .75em;
}

/* Alert & Banner Styles */
.ui-error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: fadeIn 0.4s ease-out;
}

.ui-info-banner {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: fadeIn 0.4s ease-out;
}

.ui-lookup-banner {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.5s ease-out;
}

.ui-lookup-banner::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid #22c55e;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* Share Cards - Premium Integration */
.share-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.share-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.share-card:hover {
    transform: translateY(-5px) scale(1.02);
    background: rgba(255, 255, 255, 0.05);
}

.share-card:hover::before {
    transform: translateX(100%);
}

.share-card-whatsapp {
    border-color: rgba(37, 211, 102, 0.2);
}

.share-card-whatsapp:hover {
    border-color: rgba(37, 211, 102, 0.5);
    box-shadow: 0 15px 30px -10px rgba(37, 211, 102, 0.3);
}

.share-card-native {
    border-color: rgba(59, 130, 246, 0.2);
}

.share-card-native:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 15px 30px -10px rgba(59, 130, 246, 0.3);
}

.share-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    transition: transform 0.3s ease;
}

.share-card:hover .share-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

/* Icon Buttons - Premium Tooling */
.btn-icon {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--white);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--orange);
    color: var(--orange);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.2);
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.2) !important;
}

.btn-icon:active {
    transform: translateY(0) scale(0.95);
}

/* Fiscal & Action Styles */
.action-btn {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.dropdown-menu {
    position: absolute;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
    text-align: left;
}

.dropdown-menu a, .dropdown-menu button {
    background: transparent;
    border: none;
    padding: 10px 12px;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.dropdown-menu a:hover, .dropdown-menu button:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.dropdown-menu .divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 4px 0;
}

.alert {
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.75rem;
}

.status-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-success::before { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.status-error::before { background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.status-warning::before { background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.status-pending::before { background: #6b7280; }

.pulse {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(.33); opacity: 0.8; }
    80%, 100% { opacity: 0; transform: scale(3); }
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #22c55e;
    margin-bottom: 15px;
}
