/* Custom styles for Marble Processing Business Management System */

:root {
    --primary-color: #2c5282;
    --secondary-color: #4a5568;
    --success-color: #38a169;
    --danger-color: #e53e3e;
    --warning-color: #d69e2e;
    --info-color: #3182ce;
    --light-color: #f7fafc;
    --dark-color: #2d3748;
    --marble-gray: #8795a1;
    --marble-blue: #667eea;
}

/* Global reset to prevent horizontal scroll */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* Override Bootstrap Alert Colors - Remove Colored Backgrounds */
.alert {
    background-color: #ffffff !important;
    border-width: 1px !important;
    border-style: solid !important;
}

.alert-success {
    border-color: #28a745 !important;
    color: #155724 !important;
}

.alert-danger {
    border-color: #dc3545 !important;
    color: #721c24 !important;
}

.alert-warning {
    border-color: #ffc107 !important;
    color: #856404 !important;
}

.alert-info {
    border-color: #17a2b8 !important;
    color: #0c5460 !important;
}

/* Thickness Prices Display in Catalog Cards */
.thickness-prices-display {
    margin-top: auto;
}

.thickness-prices-display .badge {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
}

.thickness-options {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.thickness-options small {
    font-size: 0.75rem;
}

/* Custom Price Input for Modal */
#customPriceInput {
    border: 1px solid #007bff !important;
    background-color: #ffffff !important;
    font-weight: bold;
    color: #007bff !important;
}

#customPriceInput:focus {
    border-color: #0056b3 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

.price-editable-hint {
    font-size: 0.7rem;
    color: #007bff;
    font-style: italic;
    margin-top: 2px;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
    max-width: 100vw;
}

/* Sidebar styles */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 999; /* Lower than navbar */
    padding: 0;
    padding-top: 75px !important; /* Space below navbar */
    margin: 0;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    background-color: #0d6efd;
    border-right: none;
    width: 250px;
    height: 100vh;
    display: block !important;
}

/* Sidebar toggle for mobile */
.sidebar-toggle {
    padding: 1rem;
    background-color: #0d6efd;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-content {
    padding: 0.5rem 0.5rem !important;
    background-color: #0d6efd;
    height: calc(100vh - 75px) !important;
    overflow-y: auto;
    margin: 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid white;
    margin-left: 0;
    padding-left: calc(1rem - 3px);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

/* Sidebar collapsed state for desktop */
.sidebar.sidebar-collapsed {
    width: 80px;
    transition: width 0.3s ease;
}

.sidebar.sidebar-collapsed .sidebar-content {
    padding: 0.5rem 0.25rem !important;
}

.sidebar.sidebar-collapsed .nav-link {
    text-align: center;
    padding: 0.75rem 0.5rem;
    position: relative;
}

.sidebar.sidebar-collapsed .nav-link span {
    display: none;
}

.sidebar.sidebar-collapsed .nav-link i {
    width: auto;
    font-size: 1.2rem;
}

.sidebar.sidebar-collapsed .sidebar-heading {
    display: none;
}

/* Tooltip for collapsed sidebar items */
.sidebar.sidebar-collapsed .nav-link:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 0.5rem;
    font-size: 0.875rem;
}

/* Main content area */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    padding: 90px 2rem 2rem 2rem; /* Top padding for navbar */
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
    max-width: calc(100vw - 250px);
}

.col-md-9.ms-sm-auto.col-lg-10 {
    padding: 90px 2rem 2rem 2rem; /* Top padding for navbar */
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
    margin-left: 250px;
}

.main-content.sidebar-collapsed,
.col-md-9.ms-sm-auto.col-lg-10.sidebar-collapsed {
    margin-left: 80px;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Mobile responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 85px 0 1rem 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .col-md-9.ms-sm-auto.col-lg-10 {
        margin-left: 0 !important;
        padding: 85px 0 1rem 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .container-fluid {
        padding: 0 !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Fix dashboard cards on mobile */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .col, [class*="col-"] {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Dashboard cards responsive */
    .col-md-3, .col-lg-3 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Tables responsive */
    .table-responsive {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .card {
        margin: 0 0.5rem !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        width: calc(100% - 1rem) !important;
    }
    
    .card-body {
        padding: 1rem !important;
        overflow-x: hidden !important;
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .col-md-3, .col-lg-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .main-content {
        padding: 1.5rem !important;
    }
}

/* Mobile landscape adjustments */
@media (max-width: 812px) and (orientation: landscape) {
    .navbar {
        min-height: 60px !important;
        height: 60px !important;
    }
    
    .navbar .container-fluid {
        height: 60px !important;
    }
    
    .sidebar {
        padding-top: 60px !important;
    }
    
    .sidebar-content {
        height: calc(100vh - 60px) !important;
    }
    
    .main-content {
        padding-top: 70px !important;
    }
}

/* Small mobile devices */
@media (max-width: 575.98px) {
    .main-content {
        padding: 85px 0 0.75rem 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .col-md-9.ms-sm-auto.col-lg-10 {
        padding: 85px 0 0.75rem 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    .card {
        margin: 0 0.25rem !important;
        width: calc(100% - 0.5rem) !important;
    }
    
    .table {
        font-size: 0.875rem !important;
    }
    
    /* Hide less important columns on small screens */
    .d-none.d-sm-table-cell {
        display: none !important;
    }
}

/* Very small devices (iPhone SE, etc) */
@media (max-width: 375px) {
    .navbar-brand {
        font-size: 0.9rem !important;
    }
    
    .main-content {
        padding: 85px 0 0.5rem 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .col-md-9.ms-sm-auto.col-lg-10 {
        padding: 85px 0 0.5rem 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Prevent overflow on all elements */
    * {
        max-width: 100vw !important;
    }
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white;
}

/* Navbar styling */
.navbar {
    padding: 0 !important;
    min-height: 75px;
    z-index: 1030; /* Bootstrap standard navbar z-index */
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    overflow: visible !important; /* Ensure dropdowns can show */
}

.navbar .container-fluid {
    padding: 0 1rem !important;
    display: flex;
    align-items: center !important;
    justify-content: space-between;
    height: 75px;
    position: relative;
    overflow: visible !important; /* Prevent container from clipping dropdowns */
}

.navbar-brand {
    font-size: 1rem !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1031;
}

.navbar-nav {
    display: flex;
    align-items: center !important;
    margin: 0;
    padding: 0 !important;
    position: relative;
    overflow: visible !important; /* Allow dropdowns to overflow */
}

/* User dropdown specific fixes */
.navbar-nav .dropdown {
    position: relative;
}

.navbar-nav .dropdown-toggle {
    position: relative;
    z-index: 1031;
}

.navbar-nav .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 9999 !important; /* Very high z-index to ensure visibility */
    margin-top: 0.5rem;
    min-width: 200px;
    transform: none !important;
    background-color: white !important; /* Ensure background is visible */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; /* Add shadow for visibility */
}

/* Prevent layout shifts */
.d-flex.align-items-center.ms-auto {
    position: relative;
    z-index: 1031;
    overflow: visible !important;
}

.navbar-nav .nav-link {
    padding: 0.25rem 0.5rem !important;
    display: flex;
    align-items: center;
}

/* Notification dropdown specific fixes */
.navbar-nav .dropdown .dropdown-menu-end {
    position: absolute !important;
    z-index: 9999 !important;
    background-color: white !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Ensure dropdowns are always on top */
.navbar .dropdown-menu.show {
    z-index: 9999 !important;
    position: absolute !important;
    display: block !important;
}

/* Fix for notification dropdown with custom width */
.navbar-nav .dropdown-menu[style*="width: 350px"] {
    z-index: 9999 !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    position: absolute !important;
    background-color: white !important;
}

/* Mobile fix for notification dropdown */
@media (max-width: 767.98px) {
    .navbar-nav .dropdown-menu[style*="width: 350px"] {
        width: 90vw !important;
        max-width: 350px !important;
        right: 5vw !important;
        left: auto !important;
    }
}

@media (max-width: 575.98px) {
    .navbar-nav .dropdown-menu[style*="width: 350px"] {
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        right: 10px !important;
        left: 10px !important;
    }
}

/* Mobile navbar adjustments */
@media (max-width: 767.98px) {
    .navbar {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        height: 56px !important;
        overflow: visible !important;
    }
    
    .navbar .container-fluid {
        padding: 0 0.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: 100% !important;
        position: relative !important;
        overflow: visible !important;
    }
    
    .navbar-brand {
        font-size: 0.9rem !important;
        flex: 1;
        position: relative !important;
        z-index: 1051 !important;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem;
        margin: 0;
        position: relative !important;
        z-index: 1051 !important;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    /* Hide user name on mobile, show only icon */
    #userDropdown .d-none.d-md-inline {
        display: none !important;
    }
    
    /* Ensure proper spacing between hamburger and user icon */
    .d-flex.align-items-center.ms-auto {
        gap: 0.5rem;
        position: relative !important;
        z-index: 1051 !important;
        overflow: visible !important;
    }
    
    /* Make user dropdown icon touch-friendly */
    #userDropdown {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        padding: 0.5rem !important;
        position: relative !important;
        z-index: 1051 !important;
    }
    
    /* Fix dropdown menu positioning */
    .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        z-index: 9999 !important;
        margin-top: 0.5rem !important;
        background-color: white !important;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    }
    
    /* Prevent layout shifts when dropdown opens */
    .navbar-nav {
        position: relative !important;
        overflow: visible !important;
    }
    
    .dropdown {
        position: relative !important;
    }
}

/* Main content area */
.container-fluid {
    padding-top: 75px; /* Account for navbar height */
}

.col-md-9.ms-sm-auto.col-lg-10 {
    margin-left: 250px;
    padding: 1.5rem;
    width: calc(100% - 250px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.col-md-9.ms-sm-auto.col-lg-10.sidebar-collapsed {
    margin-left: 80px;
    width: calc(100% - 80px);
}

@media (max-width: 767.98px) {
    .col-md-9.ms-sm-auto.col-lg-10 {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        top: 0;
        padding-top: 75px !important;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Statistics Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info,
.card.bg-danger {
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-warning .card-title,
.card.bg-info .card-title,
.card.bg-danger .card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease-in-out;
}

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

.btn-primary:hover {
    background-color: #2a4a7d;
    border-color: #2a4a7d;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-hover tbody tr:hover {
    background-color: rgba(44, 82, 130, 0.05);
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.625rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 82, 130, 0.25);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

/* Login page */
.bg-light {
    background: #ffffff !important;
    min-height: 100vh;
}

.login-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Marble catalog styles */
.marble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.marble-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.marble-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.marble-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Quote/Invoice items */
.quote-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

.quote-item:nth-child(even) {
    background: white;
}

/* Calendar styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 0.5rem;
    position: relative;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #6c757d;
}

.calendar-day.today {
    background: rgba(44, 82, 130, 0.1);
}

.appointment {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Grid and layout adjustments */
    .marble-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calendar-grid {
        font-size: 0.875rem;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Table responsiveness */
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    /* Button groups and actions */
    .btn-group {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
        width: 100%;
    }
    
    /* Card adjustments */
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    /* Form adjustments */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Navigation tabs */
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tabs .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Statistics cards */
    .card.bg-primary .card-title,
    .card.bg-success .card-title,
    .card.bg-warning .card-title,
    .card.bg-info .card-title,
    .card.bg-danger .card-title {
        font-size: 1.5rem;
    }
    
    /* Page headers - Complete centering for mobile */
    .d-flex.justify-content-between {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: center !important;
        text-align: center !important;
        justify-content: center !important;
    }
    
    .d-flex.justify-content-between h1,
    .d-flex.justify-content-between h2,
    .d-flex.justify-content-between .h1,
    .d-flex.justify-content-between .h2 {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 1rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .d-flex.justify-content-between .btn-toolbar {
        width: 100% !important;
        justify-content: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .d-flex.justify-content-between .btn,
    .d-flex.justify-content-between .btn-group .btn {
        align-self: center !important;
        min-width: 250px !important;
        margin: 0.25rem 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .d-flex.justify-content-between .btn-group {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        font-size: 0.875rem;
    }
    
    /* Fix notification dropdown positioning on mobile */
    .notification-dropdown {
        position: absolute !important;
        transform: none !important;
        right: 0 !important;
        left: auto !important;
        margin-right: 0 !important;
    }
    
    .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
    }
    
    /* Badge adjustments */
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Additional mobile styles for smaller screens */
@media (max-width: 576px) {
    /* Center page headers and buttons on mobile */
    .pt-3.pb-2.mb-3.border-bottom {
        text-align: center;
    }
    
    .pt-3.pb-2.mb-3.border-bottom h1,
    .pt-3.pb-2.mb-3.border-bottom h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .pt-3.pb-2.mb-3.border-bottom .btn-toolbar {
        justify-content: center;
        width: 100%;
    }
    
    .pt-3.pb-2.mb-3.border-bottom .btn {
        width: auto;
        min-width: 150px;
    }
    
    /* Center icons with text */
    .pt-3.pb-2.mb-3.border-bottom i {
        margin-right: 8px;
    }

    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .col-md-9.ms-sm-auto.col-lg-10 {
        padding: 0.75rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Compact table for very small screens */
    .table th,
    .table td {
        padding: 0.375rem 0.25rem;
        font-size: 0.8rem;
    }
    
    /* Stack form elements */
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Compact buttons */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Modal adjustments */
    .modal-content {
        margin: 0;
        border-radius: 0;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Navbar brand text wrapping */
    .navbar-brand {
        font-size: 0.9rem !important;
        line-height: 1.2;
    }
    
    /* Tab content scrolling */
    .tab-content {
        max-width: 100%;
        overflow-x: auto;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 200px;
    }
    
    .col-md-9.ms-sm-auto.col-lg-10 {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
    
    .calendar-day {
        min-height: 60px;
    }
}

/* Mobile-specific table improvements */
@media (max-width: 768px) {
    /* Hide less important table columns on mobile */
    .table .d-none-mobile {
        display: none !important;
    }
    
    /* Compact table cells */
    .table td, .table th {
        vertical-align: middle;
    }
    
    /* Stack table actions vertically */
    .table td:last-child {
        min-width: 100px;
    }
    
    .table td:last-child .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .table td:last-child .btn:last-child {
        margin-bottom: 0;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    /* Larger touch targets */
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Improved form inputs for mobile */
    .form-control, .form-select {
        min-height: 44px;
    }
    
    /* Better modal experience */
    .modal-dialog {
        margin: 0;
        height: 100vh;
        max-height: none;
        max-width: none;
    }
    
    .modal-content {
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    .modal-body {
        overflow-y: auto;
        flex: 1;
    }
}

/* Sidebar overlay for mobile */
@media (max-width: 767.98px) {
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .sidebar.show ~ .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .col-md-9.ms-sm-auto.col-lg-10 {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Utility classes */
.text-marble-gray {
    color: var(--marble-gray) !important;
}

.bg-marble-blue {
    background-color: #ffffff !important;
    border: 1px solid var(--marble-blue) !important;
}

.border-marble {
    border-color: var(--marble-gray) !important;
}

.shadow-marble {
    box-shadow: 0 0.5rem 1rem rgba(135, 149, 161, 0.15) !important;
}

/* Status indicators */
.status-pending {
    background-color: #ffffff;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.status-accepted {
    background-color: #ffffff;
    border: 1px solid #10b981;
    color: #065f46;
}

.status-rejected {
    background-color: #ffffff;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.status-expired {
    background-color: #ffffff;
    border: 1px solid #f97316;
    color: #9a3412;
}

/* Product catalog styles */
.price-badge {
    font-weight: 600;
    color: #28a745;
    background: none;
    padding: 0;
}

.product-description {
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    max-height: none !important;
    line-height: 1.5;
}

/* Product info icons styling */
.product-info-icons .btn-link {
    text-decoration: none !important;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 4px 8px !important;
}

.product-info-icons .btn-link:hover {
    background-color: rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.product-info-icons .info-icon-item {
    flex: 1;
    text-align: center;
}

.product-info-icons .info-icon-item i {
    font-size: 1.1rem;
}

/* Modal specifications styling */
.spec-card {
    transition: all 0.2s ease;
    border-left: 3px solid #007bff;
}

.spec-card:hover {
    background-color: #e9ecef !important;
    transform: translateY(-1px);
}

/* Drawing Controls Mobile Optimization */
.drawing-controls-mobile {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 8px;
    align-items: center !important;
    justify-content: flex-start !important;
}

.drawing-controls-mobile .btn {
    flex: 0 0 auto !important;
    min-width: 80px;
    font-size: 0.875rem;
    margin: 0 !important;
}

/* GLOBAL OVERRIDE - Force horizontal layout for all drawing controls */
.drawing-toolbar,
.drawing-toolbar .tool-group,
.drawing-controls-mobile,
#newQuoteModal .drawing-toolbar,
#newQuoteModal .tool-group,
#newQuoteModal .drawing-controls-mobile {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
}

@media (max-width: 767px) {
    .drawing-toolbar {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: flex-start !important;
        align-items: center !important;
    }
    
    .tool-group {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
        justify-content: flex-start !important;
    }
    
    .tool-label {
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        margin-right: 8px !important;
        white-space: nowrap !important;
    }
    
    .drawing-controls-mobile {
        width: 100%;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    
    .drawing-controls-mobile .btn {
        flex: 0 0 auto !important;
        min-width: 70px !important;
        padding: 6px 8px !important;
        font-size: 0.8rem !important;
    }
    
    .drawing-controls-mobile .btn i {
        font-size: 0.8rem !important;
        margin-right: 4px !important;
    }
    
    .drawing-controls-mobile .btn span {
        font-size: 0.75rem !important;
    }
    
    /* General mobile toolbar improvements */
    .btn-group {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    
    .btn-group .btn {
        margin-right: 0 !important;
        margin-bottom: 0 !important;
    }
}

/* Modern Product Card Styles */
.product-card-modern {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.product-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Product Header */
.product-header-modern {
    height: 280px;
    position: relative;
    overflow: hidden;
}

.product-image-container-modern {
    width: 100%;
    height: 100%;
    position: relative;
}

.product-image-modern {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card-modern:hover .product-image-modern {
    transform: scale(1.05);
}

.product-placeholder-modern {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
}

/* Modern Badges */
.product-badges-modern {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.badge-category {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-finish {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    padding: 4px 10px;
    border-radius: 16px;
    font-weight: 500;
    font-size: 0.7rem;
}

/* Price Overlay */
.price-overlay-modern {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.95) 0%, rgba(0, 86, 179, 0.95) 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 16px 0 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-container {
    text-align: right;
}

.price-amount {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.price-unit {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
}

.availability-modern {
    font-size: 1.2rem;
    color: #28a745;
}

/* Product Content */
.product-content-modern {
    padding: 0;
}

.product-title-section-modern {
    padding: 20px 20px 16px 20px;
    border-bottom: 1px solid #f1f3f4;
}

.product-title-modern {
    font-size: 1.3rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 12px;
    line-height: 1.3;
}

.product-info-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.info-item-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.info-item-modern i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

.info-item-modern span {
    font-weight: 500;
}

/* Specs Preview */
.specs-preview-modern {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #f1f3f4;
}

.specs-header-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.specs-list-modern {
    display: grid;
    gap: 8px;
}

.spec-item-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #007bff;
    font-size: 0.85rem;
}

.spec-key {
    font-weight: 500;
    color: #6c757d;
}

.spec-value {
    font-weight: 600;
    color: #212529;
}

.btn-specs-more {
    background: none;
    border: none;
    color: #007bff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.btn-specs-more:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Description Preview */
.description-preview-modern {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
}

.description-header-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.description-text-modern {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6c757d;
    margin: 0;
}

.btn-description-more {
    background: none;
    border: none;
    color: #007bff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0;
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.btn-description-more:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Modern Actions */
.product-actions-modern {
    padding: 20px !important;
}

.btn-modern-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-info-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .product-title-modern {
        font-size: 1.1rem;
    }
    
    .price-amount {
        font-size: 1.1rem;
    }
}

/* Product Cards Horizontal Layout */
.product-card-horizontal {
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e9ecef;
    max-height: 280px;
}

.product-card-horizontal:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.product-image-horizontal {
    position: relative;
    height: 150px;
    overflow: hidden;
}

.product-info-below-image {
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.product-price-compact {
    text-align: center;
}

.price-amount-compact {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
}

.price-unit-compact {
    color: #6c757d;
    font-size: 0.8rem;
}

.product-details-compact {
    font-size: 0.75rem;
}

.detail-line-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    color: #495057;
}

.detail-line-compact i {
    width: 12px;
    font-size: 0.7rem;
}

.color-info-compact {
    display: flex;
    align-items: center;
    gap: 6px;
}

.description-compact {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.availability-compact {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-img-horizontal {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card-horizontal:hover .product-img-horizontal {
    transform: scale(1.05);
}

.product-placeholder-horizontal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #6c757d;
}

.category-badge-horizontal {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.category-badge-horizontal .badge {
    font-size: 0.7rem;
    font-weight: 600;
}

.product-content-horizontal {
    padding: 15px 20px;
}

.product-title-horizontal {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0;
}

.price-horizontal {
    text-align: right;
}

.price-amount-horizontal {
    font-size: 1.3rem;
    font-weight: 700;
    color: #28a745;
}

.price-unit-horizontal {
    color: #6c757d;
    font-size: 0.85rem;
}

.product-details-horizontal {
    margin-bottom: 12px;
}

.detail-item-horizontal {
    font-size: 0.85rem;
    color: #495057;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.detail-item-horizontal i {
    font-size: 0.75rem;
}

.product-summary-horizontal {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.description-summary {
    margin-right: 10px;
}

.specs-summary {
    font-size: 0.8rem;
    color: #495057;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.product-actions-horizontal {
    border-left: 1px solid #e9ecef;
    background: #f8f9fa;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 0.2rem;
}

.product-list-container {
    margin-top: 20px;
}

/* Mobile Canvas and Drawing Area Optimization */
@media (max-width: 767.98px) {
    /* Canvas container mobile optimization */
    .canvas-container {
        margin: 10px !important;
        border: 2px solid #e9ecef !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        background: white !important;
        position: relative !important;
        width: calc(100vw - 40px) !important;
        max-width: 100% !important;
        height: 50vh !important;
        min-height: 300px !important;
        max-height: 500px !important;
    }
    
    /* Canvas mobile optimization */
    #drawingCanvas {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        display: block !important;
        cursor: crosshair !important;
        background: white !important;
        touch-action: manipulation !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -khtml-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
    
    /* Drawing container mobile optimization */
    .drawing-container {
        background: #f8f9fa !important;
        border-radius: 12px !important;
        padding: 15px !important;
        margin: 10px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
        overflow: hidden !important;
    }
    
    .drawing-header {
        background: white !important;
        padding: 15px !important;
        border-radius: 8px !important;
        margin-bottom: 15px !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .drawing-header h5 {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }
    
    /* Drawing toolbar mobile */
    .drawing-toolbar {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 10px !important;
        background: white !important;
        border-radius: 8px !important;
        margin-bottom: 15px !important;
        border: 1px solid #dee2e6 !important;
    }
    
    /* Drawing info mobile */
    .drawing-info {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        align-items: center !important;
        padding: 8px 12px !important;
        background: #f8f9fa !important;
        border-radius: 6px !important;
        font-size: 0.875rem !important;
    }
    
    /* Canvas overlay mobile */
    .canvas-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        pointer-events: none !important;
        z-index: 10 !important;
    }
    
    /* Mobile Toolbar Optimization */
    .btn-toolbar {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: flex-start !important;
        align-items: center !important;
        margin-bottom: 16px !important;
    }
    
    .btn-toolbar .btn-group {
        flex-shrink: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .btn-toolbar .btn {
        font-size: 0.875rem !important;
        padding: 6px 12px !important;
        white-space: nowrap !important;
    }
    
    .btn-toolbar .btn i {
        font-size: 0.875rem !important;
        margin-right: 4px !important;
    }
    
    /* Page header adjustments for mobile */
    .d-flex.justify-content-between.flex-wrap.flex-md-nowrap {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    .d-flex.justify-content-between.flex-wrap.flex-md-nowrap h1 {
        margin-bottom: 8px !important;
    }
}

/* Responsive adjustments for horizontal layout */
@media (max-width: 768px) {
    .product-card-horizontal .row {
        flex-direction: column;
    }
    
    .product-image-horizontal {
        height: 200px;
    }
    
    .product-actions-horizontal {
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
    
    .price-horizontal {
        text-align: left;
        margin-top: 10px;
    }
}

/* Notification dropdown styles */
.notification-dropdown {
    position: absolute !important;
    top: 100%;
    right: 0 !important;
    left: auto !important;
    transform: translateX(0) !important;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    width: 380px;
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
    display: none;
    animation: slideDown 0.3s ease-out;
}

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

.notification-item {
    padding: 14px 18px;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
    cursor: pointer;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    overflow: hidden;
}

.notification-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item .notification-content {
    width: 100%;
    overflow: hidden;
}

.notification-item .notification-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.notification-item .notification-message {
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.notification-item .notification-time {
    color: #adb5bd;
    font-size: 11px;
    font-weight: 500;
}

/* Notification Modal Fullscreen */
.notifications-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.notifications-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1200px;
    height: 90%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.notifications-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255,255,255,0.1);
}

.notifications-modal-body {
    height: calc(100% - 80px);
    display: flex;
}

.notifications-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
}

.notifications-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.notification-filter {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.filter-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: none;
    border: none;
    text-align: left;
    border-radius: 8px;
    transition: all 0.2s;
    color: #495057;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: white;
}

.notification-category {
    margin-bottom: 30px;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
    color: white;
}

.category-icon.system { background: #17a2b8; }
.category-icon.clients { background: #28a745; }
.category-icon.appointments { background: #ffc107; color: #212529; }
.category-icon.quotes { background: #dc3545; }
.category-icon.workflow { background: #6f42c1; }

.category-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.notification-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.2s;
    cursor: pointer;
}

.notification-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.notification-card.unread {
    border-left: 4px solid #667eea;
    background: #f8f9ff;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.notification-type {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.notification-date {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
}

.notification-title-modal {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.4;
}

.notification-message-modal {
    color: #495057;
    line-height: 1.5;
    font-size: 14px;
}

.notification-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Notification System Styles */
.notification-dropdown {
    position: absolute !important;
    top: 100%;
    right: 0 !important;
    left: auto !important;
    right: 0;
    width: 350px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1050;
    display: none;
}

.notification-dropdown .dropdown-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

.notification-dropdown .dropdown-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
}

.notification-item-dropdown {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item-dropdown:hover {
    background-color: #f8f9fa;
}

.notification-item-dropdown.unread {
    background-color: #e3f2fd;
}

.notification-item-dropdown:last-child {
    border-bottom: none;
}

.notification-content strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.notification-content p {
    margin: 0 0 4px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.notification-content small {
    color: #999;
    font-size: 12px;
}

.notification-empty {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* Notifications Modal Fullscreen */
.notifications-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.notifications-modal-content {
    background: white;
    width: 95%;
    height: 90%;
    max-width: 1200px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

.notifications-modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.notifications-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    margin-left: auto;
}

.modal-close:hover {
    opacity: 0.8;
}

.notifications-modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.notifications-sidebar {
    width: 250px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 20px;
}

.notification-filter h6 {
    margin-bottom: 15px;
    color: #495057;
    font-weight: 600;
}

.filter-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
    text-decoration: none;
}

.filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.notifications-main {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
}

.notification-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s;
}

.notification-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.notification-item.unread {
    border-left: 4px solid #007bff;
    background: #f8f9ff;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.notification-type {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.notification-time {
    color: #6c757d;
    font-size: 14px;
}

.notification-title {
    margin: 0 0 10px 0;
    color: #212529;
    font-size: 18px;
    font-weight: 600;
}

.notification-message {
    margin: 0 0 15px 0;
    color: #495057;
    line-height: 1.5;
}

.no-notifications {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 18px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .notification-dropdown {
        position: absolute !important;
        width: auto;
        max-width: calc(100vw - 20px);
        min-width: 300px;
        right: 0 !important;
        left: auto !important;
        margin-right: 10px;
        transform: none !important;
        max-width: 380px;
        right: 10px !important;
        left: 10px !important;
        top: 60px !important;
        margin: 0 auto;
        z-index: 9999 !important;
    }
    
    .notifications-modal-content {
        width: 98%;
        height: 95%;
    }
    
    .notifications-modal-body {
        flex-direction: column;
    }
    
    .notifications-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding: 15px;
    }
    
    .notification-filter {
        display: flex;
        gap: 10px;
        overflow-x: auto;
    }
    
    .filter-btn {
        min-width: 120px;
        margin-bottom: 0;
    }
    
    .notifications-main {
        padding: 15px 20px;
    }
}
}

.notification-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-notif {
    background: #667eea;
    color: white;
}

.btn-primary-notif:hover {
    background: #5a6fd8;
}

.btn-secondary-notif {
    background: #6c757d;
    color: white;
}

.btn-secondary-notif:hover {
    background: #5a6268;
}

.empty-notifications {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-notifications i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #adb5bd;
}
