/* Business Control - Standalone Website Styles */
.dashboard-compact .card {
    border-radius: 10px;
}
.dashboard-compact .card-body { padding: 1rem; }
.dashboard-compact h1, .dashboard-compact h2, .dashboard-compact h5 { margin-bottom: 0.5rem; }
.dashboard-compact .btn { padding: 0.4rem 0.75rem; font-size: 0.9rem; }
.dashboard-compact .quick-card .btn { width: 160px; max-width: 100%; }
.dashboard-compact .quick-card .card-body { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.dashboard-grid .grid-col-3 { grid-column: span 3; }
.dashboard-grid .grid-col-4 { grid-column: span 4; }
.dashboard-grid .grid-col-6 { grid-column: span 6; }
.dashboard-grid .grid-col-12 { grid-column: span 12; }
.stat-card { display:flex; align-items:center; justify-content:space-between; border-radius:10px; }
.stat-card .h4 { font-size: 1.25rem; }
.stat-card .small { font-size: 0.75rem; }
.section-title { display:flex; align-items:center; gap:8px; font-weight:600; color:#495057; margin-bottom: 8px; }
.section-title .dot { width:8px; height:8px; border-radius:50%; background:#0d6efd; display:inline-block; }
.card-divider { height:1px; background:#e9ecef; margin: 8px 0 12px; }

@media (max-width: 992px) {
  .dashboard-grid .grid-col-3, .dashboard-grid .grid-col-4 { grid-column: span 6; }
}
@media (max-width: 576px) {
  .dashboard-grid .grid-col-3, .dashboard-grid .grid-col-4, .dashboard-grid .grid-col-6 { grid-column: span 12; }
}

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.15s ease-in-out;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    margin: 0;
    padding: 0;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%) !important;
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: white !important;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.8) !important;
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: white !important;
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background: white;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem 1.25rem;
}

/* User tracking badges */
.badge.bg-info {
    background-color: #17a2b8 !important;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.badge.bg-info:hover {
    background-color: #138496 !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Appointment item styling */
.appointment-item {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
    transition: all 0.2s ease;
}

.appointment-item:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.appointment-date {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.appointment-client {
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.appointment-notes {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.appointment-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Table styling for appointments */
.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.15s ease-in-out;
}

/* Sidebar Navigation Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    z-index: 1050;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    transform: translateX(-220px);
}

.sidebar-header {
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
}

.sidebar-brand i {
    font-size: 1.3rem;
    margin-right: 0.5rem;
    color: #3498db;
}

.sidebar-user {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info i {
    font-size: 1.5rem;
    color: #3498db;
}

.user-info span {
    font-weight: 500;
    color: white;
    font-size: 0.9rem;
}

.sidebar-user .dropdown-toggle {
    color: rgba(255,255,255,0.8);
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

.sidebar-user .dropdown-toggle:hover {
    color: white;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu .nav-item {
    margin: 0.15rem 0;
}

.nav-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.nav-menu .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #3498db;
}

.nav-menu .nav-link.active {
    background-color: rgba(52, 152, 219, 0.2);
    color: white;
    border-left-color: #3498db;
}

.nav-menu .nav-link i {
    width: 18px;
    margin-right: 0.6rem;
    text-align: center;
    font-size: 0.9rem;
}



.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
}

/* Main content adjustment */
body {
    padding-left: 260px;
    transition: padding-left 0.3s ease;
}

body.sidebar-collapsed {
    padding-left: 40px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    body {
        padding-left: 0;
    }
    
    .sidebar-overlay.mobile-open {
        display: block;
    }
}

/* Content wrapper */
.content-wrapper {
    min-height: 100vh;
    background-color: #f5f5f5;
}

.card-body {
    padding: 1.5rem;
}

.card.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%) !important;
}

.card.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%) !important;
}

.card.bg-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%) !important;
}

.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
    color: #212529;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
    color: white;
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-warning {
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
    background: transparent;
}

.btn-outline-warning:hover {
    background: var(--warning-color);
    color: #212529;
}

.btn-outline-danger {
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
}

.btn-outline-secondary {
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: var(--transition);
    padding: 0.75rem;
    width: 100%;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: block;
}

.form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: var(--transition);
    padding: 0.75rem;
    width: 100%;
    font-size: 1rem;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    background: white;
    width: 100%;
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.badge {
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
    color: #212529;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-xl {
    max-width: 90%;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.file-upload-area {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    background-color: #f8f9fa;
    margin-bottom: 1rem;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.05);
}

.file-upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.upload-icon {
    font-size: 2rem;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.file-name {
    font-size: 0.875rem;
    color: var(--dark-color);
}

.remove-file {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
}

.remove-file:hover {
    color: #c82333;
}

.client-search-container {
    position: relative;
}

.client-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.client-option {
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #f8f9fa;
}

.client-option:hover {
    background-color: #f8f9fa;
}

.client-option:last-child {
    border-bottom: none;
}

.total-display {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
}

.total-display h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.extraction-info {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
}

.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group .btn {
    border-radius: 0;
    margin-right: -1px;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    margin-right: 0;
}

.text-muted {
    color: var(--secondary-color) !important;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }

.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.align-items-center { align-items: center !important; }
.align-self-center { align-self: center !important; }

.text-white { color: white !important; }
.bg-white { background-color: white !important; }

@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .modal-xl {
        max-width: 95%;
        margin: 1rem;
    }
    
    .form-section h4 {
        font-size: 1.1rem;
    }
    
    .file-upload-area {
        padding: 1rem;
    }
    
    .upload-icon {
        font-size: 1.5rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: var(--border-radius) !important;
        margin-right: 0 !important;
        margin-bottom: 0.25rem;
    }
}

/* Calendar styles */
.calendar-grid {
    display: grid;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.calendar-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-row.header .calendar-cell {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    text-align: center;
    font-weight: 700;
    color: white;
    min-height: 50px;
    padding: 15px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-cell {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    min-height: 120px;
    padding: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.calendar-cell:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.calendar-cell.empty {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    cursor: default;
    opacity: 0.6;
}

.calendar-cell.empty:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calendar-cell.today {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    color: white;
}

.calendar-cell.today .day-number {
    color: white;
}

.day-number {
    font-weight: 700;
    color: #495057;
    margin-bottom: 8px;
    font-size: 1.1rem;
    text-align: center;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
}

.calendar-cell.today .day-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.badge-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

.badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    color: white;
    display: inline-block;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.badge.mounting {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

.badge.appointment {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

/* Calendar controls styling */
.calendar-controls {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#current-month-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
    text-transform: capitalize;
}

.calendar-controls .btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.calendar-controls .btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.appointments-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.appointment-item {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.appointment-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.appointment-date {
    font-weight: 700;
    color: #007bff;
    margin-bottom: 8px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.appointment-date::before {
    content: "ðŸ“…";
    font-size: 1.2rem;
}

.appointment-client {
    color: #495057;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.appointment-client::before {
    content: "ðŸ‘¤";
    font-size: 1.1rem;
}

.appointment-notes {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.appointment-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.appointment-actions .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.appointment-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Empty state styling */
.appointments-container p {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Today and Tomorrow sections styling */
#today-list .appointment-item {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #ffffff 100%);
}

#tomorrow-list .appointment-item {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fffdf8 0%, #ffffff 100%);
}

#today-list .appointment-date {
    color: #28a745;
    font-weight: bold;
}

#tomorrow-list .appointment-date {
    color: #ffc107;
    font-weight: bold;
}

/* ==================== EXPENSES CALENDAR STYLES ==================== */

.calendar-grid {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
}

.calendar-day-header {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    border-right: 1px solid #dee2e6;
}

.calendar-day-header:last-child {
    border-right: none;
}

.calendar-body {
    display: flex;
    flex-direction: column;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 80px;
}

.calendar-day {
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-day:hover {
    background-color: #f8f9fa;
    transform: scale(1.02);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-day.current-month {
    background-color: white;
}

.calendar-day.other-month {
    background-color: #f8f9fa;
    color: #6c757d;
}

.calendar-day.today {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    font-weight: bold;
}

.calendar-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.calendar-day.other-month .calendar-date {
    color: #adb5bd;
}

.calendar-day.today .calendar-date {
    color: #1976d2;
}

.calendar-expenses {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 4px;
    margin-top: 4px;
}

.expense-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 2px;
}

.expense-total {
    font-size: 0.8rem;
    font-weight: bold;
    color: #155724;
}

.calendar-day:hover .calendar-expenses {
    background: rgba(40, 167, 69, 0.2);
    transform: scale(1.05);
}

/* Responsive calendar */
@media (max-width: 768px) {
    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }
    
    .calendar-date {
        font-size: 0.8rem;
    }
    
    .expense-count {
        font-size: 0.6rem;
    }
    
    .expense-total {
        font-size: 0.7rem;
    }
    
    .calendar-day-header {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
}

/* ==================== MOBILE OPTIMIZATION ENHANCEMENTS ==================== */

/* Enhanced Mobile Responsiveness */
@media (max-width: 1200px) {
    .dashboard-grid .grid-col-3 { grid-column: span 4; }
    .dashboard-grid .grid-col-4 { grid-column: span 6; }
    .dashboard-grid .grid-col-6 { grid-column: span 8; }
}

@media (max-width: 992px) {
    .dashboard-grid .grid-col-3, .dashboard-grid .grid-col-4 { grid-column: span 6; }
    .dashboard-grid .grid-col-6 { grid-column: span 12; }
    
    /* Improve card layouts on tablets */
    .card-body { padding: 1.25rem; }
    .btn { padding: 0.6rem 1.2rem; font-size: 0.95rem; }
}

@media (max-width: 768px) {
    /* Mobile-first improvements */
    .container-fluid { padding: 0.75rem; }
    
    /* Enhanced mobile sidebar navigation */
    .sidebar {
        transform: translateX(-100%);
        width: 240px; /* Smaller width for mobile */
        z-index: 1060; /* Higher z-index for mobile */
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    
    body {
        padding-left: 0;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    

    

    
    /* Enhanced card styling for mobile */
    .card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px; /* iOS recommended touch target */
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 0.75rem;
    }
    
    /* Mobile-optimized forms */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
    
    .form-label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile table improvements */
    .table-responsive {
        border-radius: 0.5rem;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.75rem 0.5rem;
        vertical-align: middle;
    }
    
    /* Mobile modal improvements */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.75rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Mobile calendar improvements */
    .calendar-grid {
        padding: 0.75rem;
        gap: 8px;
    }
    
    .calendar-cell {
        min-height: 80px;
        padding: 8px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 6px;
    }
    
    /* Mobile appointment calendar styles */
    .calendar-appointments {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 2px;
    }
    
    .appointment-count {
        font-size: 0.7rem;
        font-weight: 600;
        padding: 2px 4px;
        border-radius: 4px;
        background: rgba(0, 123, 255, 0.1);
        color: #007bff;
        white-space: nowrap;
    }
    
    .appointment-count.mounting {
        background: rgba(255, 193, 7, 0.2);
        color: #ffc107;
    }
    
    .appointment-count.other {
        background: rgba(40, 167, 69, 0.2);
        color: #28a745;
    }
    
    .calendar-day:hover .calendar-appointments {
        background: rgba(0, 123, 255, 0.1);
        transform: scale(1.05);
    }
    
    /* Day appointments modal styles */
    .day-appointments .appointment-item {
        transition: all 0.2s ease;
    }
    
    .day-appointments .appointment-item:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }
    
    .day-appointments .btn-group-vertical .btn {
        margin-bottom: 2px;
    }
    
    .day-appointments .btn-group-vertical .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Mobile appointment improvements */
    .appointment-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .appointment-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .appointment-actions .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Enhanced mobile sidebar improvements */
    .sidebar-nav .nav-link {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        border-radius: 0.5rem;
        margin: 0.2rem 0.4rem;
    }
    
    .sidebar-nav .nav-link i {
        width: 24px;
        font-size: 1.1rem;
        margin-right: 0.75rem;
    }
    
    .sidebar-nav .nav-link:hover {
        background-color: rgba(255,255,255,0.15);
        transform: translateX(4px);
    }
    
    .sidebar-nav .nav-link.active {
        background-color: rgba(52, 152, 219, 0.3);
        border-left-color: #3498db;
        border-left-width: 4px;
    }
    
    /* Mobile sidebar header improvements */
    .sidebar-header {
        padding: 1rem 0.875rem;
        border-bottom: 2px solid rgba(255,255,255,0.1);
    }
    
    .sidebar-brand {
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .sidebar-brand i {
        font-size: 1.3rem;
        margin-right: 0.75rem;
    }
    
    /* Mobile sidebar user section improvements */
    .sidebar-user {
        padding: 0.875rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .user-info {
        gap: 0.625rem;
    }
    
    .user-info i {
        font-size: 1.5rem;
    }
    
    .user-info span {
        font-size: 0.95rem;
        font-weight: 600;
    }
    
    /* Mobile overlay improvements */
    .sidebar-overlay.mobile-open {
        display: block;
        backdrop-filter: blur(3px);
        background-color: rgba(0,0,0,0.6);
    }
    
    /* Mobile dashboard improvements */
    .dashboard-compact .card-body {
        padding: 1rem;
    }
    
    .dashboard-compact .quick-card .btn {
        width: 100%;
        max-width: none;
    }
    
    /* Mobile file upload improvements */
    .file-upload-area {
        padding: 1.5rem 1rem;
    }
    
    .file-upload-label {
        font-size: 1rem;
    }
    
    /* Mobile badge improvements */
    .badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile content wrapper improvements */
    .content-wrapper {
        padding-top: 0;
    }
    
    /* Mobile page header improvements */
    .content-wrapper h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
        padding-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    /* Small mobile optimizations */
    .dashboard-grid .grid-col-3, 
    .dashboard-grid .grid-col-4, 
    .dashboard-grid .grid-col-6 { 
        grid-column: span 12; 
    }
    
    .container-fluid {
        padding: 0.5rem;
    }
    
    /* Extra small mobile improvements */
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    /* Mobile form improvements */
    .form-section {
        margin-bottom: 1.5rem;
    }
    
    .form-section h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Mobile table improvements */
    .table {
        font-size: 0.8rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Mobile calendar improvements */
    .calendar-controls {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    #current-month-display {
        font-size: 1.25rem;
    }
    
    .calendar-controls .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Mobile modal improvements */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 0.75rem;
    }
    
    /* Mobile sidebar improvements */
    .sidebar {
        width: 260px;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-user {
        padding: 0.75rem;
    }
    
    /* Mobile navigation improvements */
    .nav-menu .nav-item {
        margin: 0.15rem 0;
    }
    
    .nav-menu .nav-link {
        padding: 1rem;
        font-size: 0.95rem;
        margin: 0.15rem 0.25rem;
    }
    

}

/* Touch-friendly improvements for all devices */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .dropdown-toggle {
        min-height: 44px;
        padding: 0.75rem;
    }
    
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* Better touch feedback */
    .btn:active {
        transform: scale(0.98);
    }
    
    .card:active {
        transform: scale(0.99);
    }
    
    /* Sidebar touch improvements */
    .sidebar-nav .nav-link:active {
        transform: scale(0.98);
        background-color: rgba(255,255,255,0.2);
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .calendar-cell {
        min-height: 60px;
    }
    
    .appointment-item {
        padding: 0.75rem;
    }
    

}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn, .form-control, .card {
        border-width: 0.5px;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) {
    .sidebar {
        background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .card {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .form-control, .form-select {
        background: #2d2d2d;
        color: #ffffff;
        border-color: #404040;
    }
    

}

/* Accessibility improvements for mobile */
@media (prefers-reduced-motion: reduce) {
    .btn, .card, .nav-link, .sidebar {
        transition: none;
    }
    
    .btn:hover, .card:hover, .nav-link:hover {
        transform: none;
    }
}

/* Print styles for mobile */
@media print {
    .sidebar, .btn, .modal {
        display: none !important;
    }
    
    body {
        padding-left: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ==================== SPLITTER STYLES - 3 panels: history | center | right ==================== */
/* Container: never wider than viewport; third column must stay inside */
.splitter-container {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 400px;
    position: relative;
    background: #ffffff;
    overflow: hidden;
}

/* Column 1: fixed width */
.history-panel {
    flex: 0 0 auto;
    width: 240px;
    min-width: 180px;
    max-width: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-right: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
}

/* Column 2: takes more space (main content) */
.center-panel {
    flex: 1 1 55%;
    min-width: 280px;
    max-width: 65%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    background: #f8f9fa;
    border-right: 1px solid #e2e8f0;
}

/* Column 3: PDF preview – a bit wider */
.right-panel {
    flex: 0 1 38%;
    min-width: 0;
    max-width: 460px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.splitter-divider {
    width: 4px;
    background: #c0c0c0;
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
    z-index: 10;
}

.splitter-divider:hover,
.splitter-divider-left:hover {
    background: #0078d4;
    width: 4px;
}

.splitter-divider.dragging,
.splitter-divider-left.dragging {
    background: #0078d4;
    width: 4px;
}

.splitter-divider-left {
    width: 4px;
    background: #c0c0c0;
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
    z-index: 10;
}

.splitter-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.splitter-divider:hover .splitter-handle::before,
.splitter-divider.dragging .splitter-handle::before,
.splitter-divider-left:hover .splitter-handle::before,
.splitter-divider-left.dragging .splitter-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
}

/* Splitter content styles */
.log-area {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.log-area h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-weight: 600;
}

.log-content {
    flex: 1;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

.log-content.empty {
    color: #6c757d;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.settings-panel {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
}

.costs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.cost-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cost-item label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9rem;
}

.cost-item input {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.cost-item input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.entries-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.entries-panel h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-weight: 600;
}

.entry-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.entry-item:hover {
    background-color: #f8f9fa;
}

.entry-item:last-child {
    border-bottom: none;
}

.entry-checkbox {
    cursor: pointer;
}

.entry-info {
    flex: 1;
}

.entry-name {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.entry-prices {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Save feedback message - visible confirmation after Salva */
.save-feedback {
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    min-height: 1.2em;
    display: none;
}
.save-feedback.save-feedback-ok {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.save-feedback.save-feedback-err {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.status-indicator {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    margin-top: 1rem;
    text-align: center;
}

.status-indicator.status-ready {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-indicator.status-processing {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-indicator.status-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-indicator.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.file-input-container {
    margin-bottom: 1.5rem;
}

.file-input-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.file-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.file-input-container.dragover {
    background: rgba(0, 123, 255, 0.1);
    border-color: var(--primary-color);
}

/* Responsive splitter - 3 panels stack vertically */
@media (max-width: 768px) {
    .splitter-container {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }
    
    .history-panel {
        width: 100% !important;
        min-width: auto;
        max-width: none;
        max-height: 200px;
        min-height: 160px;
        border-right: none;
        border-bottom: 1px solid #cbd5e1;
    }
    
    .center-panel {
        flex: none;
        min-width: auto;
        max-width: none;
        min-height: 280px;
        border-right: none;
        border-bottom: 1px solid #c0c0c0;
    }
    
    .right-panel {
        flex: none;
        min-width: auto;
        min-height: 220px;
    }
    
    .splitter-divider,
    .splitter-divider-left {
        width: 100%;
        height: 12px;
        min-height: 12px;
        cursor: row-resize;
        border-left: none;
        border-right: none;
        border-top: 1px solid #c0c0c0;
        border-bottom: 1px solid #c0c0c0;
    }
    
    .splitter-handle {
        width: 40px;
        height: 4px;
        left: 50%;
        top: 50%;
    }
    
    .costs-grid {
        grid-template-columns: 1fr;
    }
    
    .app-body .center-panel,
    .app-body .right-panel {
        padding: 1rem;
    }
    
    .app-body .history-panel {
        padding: 0.75rem 1rem;
    }
}

/* Safe-area for notched / rounded devices (mobile) */
@supports (padding: env(safe-area-inset-top)) {
    @media (max-width: 768px) {
        body {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
            padding-top: env(safe-area-inset-top);
        }
    }
    .landing-nav .container-fluid {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }
    .navbar .container-fluid {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    .content-wrapper .container-fluid {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* ==================== DIVISORE PREZZI - Enhanced look ==================== */
.app-body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
}

.app-body .content-wrapper {
    background: linear-gradient(165deg, #f0f7ff 0%, #e8f4fd 25%, #f0f9ff 50%, #eef2ff 75%, #f8fafc 100%);
    min-height: 100vh;
    padding: 1.5rem 0 0;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.app-body .content-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.app-body .content-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 50%;
    height: 80%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.app-body .content-wrapper .container-fluid {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    padding-bottom: 0.5rem;
}

/* Page header - eye-catching title */
.splitter-page-header {
    margin-bottom: 0.5rem;
}

.splitter-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.35rem 0;
    line-height: 1.2;
}

.splitter-title i {
    -webkit-text-fill-color: #0ea5e9;
}

.splitter-plan-badge {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #e2e8f0;
    vertical-align: middle;
    -webkit-text-fill-color: #64748b;
}

.splitter-tagline {
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.01em;
}

.splitter-header-divider {
    border: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #0ea5e9 20%, #38bdf8 50%, #0ea5e9 80%, transparent 100%);
    margin: 1.25rem 0 1.5rem;
    border-radius: 2px;
    opacity: 0.9;
}

/* Tabs - pill style with shine */
.app-body .tab-navigation {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.app-body .tab-btn {
    padding: 0.7rem 1.4rem;
    border-radius: 2rem;
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.app-body .tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.app-body .tab-btn:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.2);
}

.app-body .tab-btn:hover::before {
    left: 100%;
}

.app-body .tab-btn.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.app-body .tab-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(14, 165, 233, 0.45);
}

/* Splitter container - full-width stretch, never overflow viewport */
.app-body .splitter-container {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
    background: transparent;
}

.app-body .history-panel {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 1rem;
    border-right: 1px solid #cbd5e1;
}

.app-body .center-panel {
    background: linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
    padding: 1.75rem;
    border-right: 1px solid #e2e8f0;
}

.app-body .right-panel {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.75rem;
}

.app-body .center-panel h4,
.app-body .right-panel .entries-panel h4 {
    color: #1e293b;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0ea5e9;
    display: inline-block;
}

/* File drop zone - inviting and interactive */
.app-body .file-input-container {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 1.75rem;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    transition: all 0.3s ease;
    position: relative;
}

.app-body .file-input-container::after {
    content: '';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230ea5e9' viewBox='0 0 24 24' opacity='0.4'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E") no-repeat center;
    background-size: 28px;
}

.app-body .file-input-container:hover,
.app-body .file-input-container.dragover {
    border-color: #0ea5e9;
    border-style: solid;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.06) 0%, rgba(14, 165, 233, 0.02) 100%);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12), inset 0 0 30px rgba(14, 165, 233, 0.04);
}

.app-body .file-input-container.dragover::after {
    opacity: 0.8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230ea5e9' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.app-body .file-input-container label {
    color: #334155;
    font-weight: 700;
    font-size: 1rem;
}

/* Settings panel - cards with accent */
.app-body .settings-panel {
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.5rem 1.75rem;
    margin: 1rem 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0ea5e9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.25s ease;
}

.app-body .settings-panel:hover {
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.08);
}

/* Cost inputs */
.app-body .cost-item label {
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
}

.app-body .cost-item input[type="number"],
.app-body .cost-item input[type="text"],
.app-body .file-input {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fff;
}

.app-body .cost-item input:focus,
.app-body .file-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

/* Buttons */
.app-body .button-group .btn {
    border-radius: 10px;
    padding: 0.65rem 1.35rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    border: none;
}

.app-body .button-group .btn.primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}

.app-body .button-group .btn.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.45);
}

.app-body .button-group .btn.secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #fff;
}

.app-body .button-group .btn.secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.35);
}

.app-body .button-group .btn.outline {
    background: #fff;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.app-body .button-group .btn.outline:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.06);
    transform: translateY(-1px);
}

/* Resizable divider */
.app-body .splitter-divider {
    background: #e2e8f0;
    width: 6px;
    border-radius: 3px;
}

.app-body .splitter-divider:hover,
.app-body .splitter-divider.dragging {
    background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
    width: 8px;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

.app-body .splitter-divider:hover .splitter-handle::before,
.app-body .splitter-divider.dragging .splitter-handle::before {
    height: 40px;
    background: rgba(255,255,255,0.95);
}

/* Entries list */
.app-body .entries-panel #entries-list {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #1e293b;
}

.app-body .entry-item {
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border: 1px solid rgba(148, 163, 184, 0.15);
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.app-body .entry-item:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: rgba(14, 165, 233, 0.4);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.app-body .entry-name {
    color: #f1f5f9;
}

.app-body .entry-prices {
    color: #94a3b8;
}

.app-body #select-all-btn,
.app-body #deselect-all-btn {
    border-radius: 8px;
    font-weight: 600;
}

/* Status & progress */
.app-body .status-indicator {
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.app-body .status-indicator.status-ready {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.app-body .status-indicator.status-processing {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.app-body .status-indicator.status-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.app-body .status-indicator.status-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #f87171;
}

.app-body .progress-bar {
    border-radius: 10px;
    height: 10px;
    background: #e2e8f0;
    overflow: hidden;
}

.app-body .progress-fill {
    background: linear-gradient(90deg, #0ea5e9 0%, #0284c7 100%);
    border-radius: 10px;
}

/* Important info textarea (in tab) */
.app-body #important-info-text {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    font-family: 'Consolas', 'Monaco', monospace;
}

.app-body #important-info-text:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* Storico preventivi - history panel (left column) */
.app-body .history-panel h4 {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0ea5e9;
    font-size: 1rem;
    display: block;
}

.app-body .history-panel .btn-refresh-history {
    margin-bottom: 0.75rem;
}

.app-body .btn-refresh-history {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.app-body .history-panel .preventivi-history-list {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    flex: 1;
    min-height: 120px;
    max-height: none;
    overflow-y: auto;
}

.app-body .preventivi-history-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-body .preventivi-history-ul li {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.app-body .preventivi-history-ul li:last-child {
    border-bottom: none;
}

.app-body .preventivi-history-ul li:hover {
    background: rgba(14, 165, 233, 0.06);
}

.app-body .preventivi-history-filename {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-body .preventivi-history-ul a.preventivi-history-filename {
    color: #0ea5e9;
    text-decoration: none;
}

.app-body .preventivi-history-ul a.preventivi-history-filename:hover {
    text-decoration: underline;
}

.app-body .preventivi-history-date {
    font-size: 0.8rem;
    color: #64748b;
}

.app-body .preventivi-history-empty {
    margin: 0;
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}
