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

:root {
    --bg-dark: #07070f;
    --bg-card: rgba(18, 18, 35, 0.7);
    --bg-card-hover: rgba(26, 26, 50, 0.9);
    --border-glass: rgba(255, 255, 255, 0.06);
    --primary: #7c3aed; /* Violeta */
    --primary-glow: rgba(124, 58, 237, 0.4);
    --secondary: #db2777; /* Rosa/Fucsia */
    --secondary-glow: rgba(219, 39, 119, 0.4);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 260px;
    --sidebar-glow: rgba(124, 58, 237, 0.05);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(219, 39, 119, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 10, 22, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    text-decoration: none;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-logo svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.menu-item a svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

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

.menu-item a:hover svg {
    transform: translateX(3px);
}

.menu-item.active a {
    color: white;
    background: linear-gradient(135deg, var(--primary), rgba(124, 58, 237, 0.4));
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1rem;
    box-shadow: 0 0 10px rgba(219, 39, 119, 0.3);
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Main Content */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(7, 7, 15, 0.5);
    backdrop-filter: blur(10px);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
}

/* Cards / Glass Container */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px 0 rgba(124, 58, 237, 0.05);
}

.glass-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 1rem;
}

.glass-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Grid Layouts */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary), rgba(124, 58, 237, 0.5));
    box-shadow: 0 0 15px var(--primary-glow);
}

.stat-icon.secondary {
    background: linear-gradient(135deg, var(--secondary), rgba(219, 39, 119, 0.5));
    box-shadow: 0 0 15px var(--secondary-glow);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success), rgba(16, 185, 129, 0.5));
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning), rgba(245, 158, 11, 0.5));
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Forms styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

select.form-control option {
    background-color: #0f0f22;
    color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary { background: rgba(124, 58, 237, 0.15); color: #a78bfa; border: 1px solid rgba(124, 58, 237, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    text-align: left;
}

.table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.95rem;
    color: var(--text-main);
    vertical-align: middle;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Image preview & inventory specific */
.product-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    background: #0d0c1d;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-glass);
    background: #0d0c1d;
}

.product-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.product-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.75rem;
}

.product-card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.image-preview-box {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--border-glass);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dynamic Interactive Quote Builder */
.quote-builder-table th {
    padding: 0.75rem 0.5rem;
}

.quote-builder-table td {
    padding: 0.75rem 0.5rem;
}

.btn-icon-only {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-icon-only.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.quote-summary {
    max-width: 400px;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

/* Modal dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 10, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-container {
    background: #0f0f24;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Alert notifications */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

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

/* Quote detail view specific styling */
.quote-view-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .quote-view-container {
        grid-template-columns: 1fr;
    }
}

.company-branding {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.quote-view-title {
    text-align: right;
}

.quote-view-title h1 {
    font-size: 1.75rem;
    color: white;
    margin-bottom: 0.25rem;
}

.quote-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    padding: 1.25rem 0;
}

/* Login Page specific */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124,58,237,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h2 {
    font-size: 1.5rem;
    color: white;
    font-weight: 700;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Settings Tabs */
.tabs-header {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

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

.tab-btn.active {
    color: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Print Styling for window.print() */
@media print {
    body {
        background: white !important;
        color: black !important;
        background-image: none !important;
        font-size: 12pt;
    }
    
    .sidebar, .topbar, .btn, .no-print, .modal-overlay, .modal-container {
        display: none !important;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .content-body {
        padding: 0 !important;
    }
    
    .glass-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        backdrop-filter: none !important;
    }
    
    .table th {
        background: #f3f4f6 !important;
        color: black !important;
        border-bottom: 2px solid #000 !important;
    }
    
    .table td {
        color: black !important;
        border-bottom: 1px solid #e5e7eb !important;
    }
    
    .badge {
        border: none !important;
        background: transparent !important;
        color: black !important;
        font-weight: bold;
        padding: 0 !important;
    }
    
    .quote-parties {
        border-top: 1px solid #ccc !important;
        border-bottom: 1px solid #ccc !important;
    }
    
    .quote-summary {
        background: transparent !important;
        border: 1px solid #ccc !important;
    }
}
