﻿/* Professional CRM CSS - Enhanced Version */
* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    color: #1f2937;
    line-height: 1.6;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* Enhanced Sidebar */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: #fff;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.sidebar .brand {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar .header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 24px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.sidebar .header-logo img {
    max-width: 160px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.sidebar .header-logo:hover img {
    transform: scale(1.08);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar nav a {
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.sidebar nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(255, 130, 73, 0.2);
}

.sidebar nav a:hover::before {
    transform: scaleY(1);
}

.sidebar nav a:active {
    transform: translateX(2px) scale(0.98);
}

/* Navigation Groups */
.nav-group {
    margin: 4px 0;
}

.nav-group-title {
    color: #9ca3af;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-group-title:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
}

.nav-group-title .nav-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-group.collapsed .nav-arrow {
    transform: rotate(-90deg);
}

.nav-group-items {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    padding-left: 8px;
}

.nav-group.collapsed .nav-group-items {
    max-height: 0;
    opacity: 0;
}

.nav-group-items a {
    padding: 10px 16px 10px 24px;
    font-size: 13px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 8px;
    border-radius: 0 8px 8px 0;
}

.nav-group-items a:hover {
    border-left-color: #FF8249;
}

.sidebar-footer {
    position: fixed;
    bottom: 20px;
    left: 16px;
    width: 208px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.sidebar-footer .user {
    padding: 8px 0;
    margin-bottom: 12px;
    color: #e5e7eb;
    font-weight: 500;
    font-size: 13px;
    word-break: break-word;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    color: #60a5fa;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}

.sidebar-footer a:hover {
    color: #93c5fd;
    transform: translateX(2px);
}

.main {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 0 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.topbar h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Global Search */
.global-search {
    position: relative;
}

#globalSearchInput {
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

#globalSearchInput:focus {
    outline: none;
    border-color: #FF8249;
    box-shadow: 0 0 0 3px rgba(255, 130, 73, 0.1);
    width: 280px;
}

#searchResults {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.search-result-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.search-result-item:hover {
    background: #eff6ff !important;
}

/* Keyboard hint */
#globalSearchInput::placeholder {
    color: #9ca3af;
}

@media (min-width: 1024px) {
    #globalSearchInput {
        width: 250px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.quotation-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 20px;
}

/* Enhanced Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.card {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FF8249 0%, #AE1607 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 6px 12px rgba(0, 0, 0, 0.08);
}

.card:hover::before {
    transform: scaleX(1);
}

.card h3 {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card p {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.big-number {
    font-size: 40px;
    font-weight: 800;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card[style*="background"] .big-number {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: #fff !important;
}

.card small {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    color: #fff !important;
}

.card[style*="background"] small {
    color: #fff !important;
}

section {
    margin: 0px;
}

section h3 {
    font-size: 18px;
    margin: 0 0 16px;
    color: #1f2937;
    font-weight: 700;
}

/* Enhanced Tables */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Popover for new quotation triggered by the "+ Nuovo preventivo" button */
.new-quote-popover {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1200;
    width: min(980px, 95vw);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.3);
    padding: 16px;
}
.new-quote-popover.visible { display: block; }

/* Overlay to emphasize the popover (similar to other tooltip/modal patterns) */
.new-quote-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1100;
}
.new-quote-overlay.visible { display: block; }

@media (max-width: 720px) {
    .new-quote-popover {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 80px;
        width: auto;
        max-height: calc(100vh - 160px);
    }
}

/* Minor button styling for the toggle */
#toggle-new-quote-btn { transition: transform 0.12s ease, box-shadow 0.12s ease; }
#toggle-new-quote-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,185,129,0.12); }

/* Z-Index utilities (standardize layers across app) */
.z-dropdown { z-index: 1000 !important; }
.z-popover { z-index: 1200 !important; }
.z-overlay { z-index: 1100 !important; }
.z-modal-overlay { z-index: 1300 !important; }
.z-modal { z-index: 1310 !important; }
.z-topmost { z-index: 1400 !important; }

.table thead {
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    border-bottom: 2px solid #AE1607;
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.table td {
    padding: 14px 10px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 11px;
    color: #374151;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.table tbody tr:hover {
    background: #eef2ff;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(255, 130, 73, 0.1);
}

.table tbody tr:last-child td {
    border-bottom: none;
}
.table tbody tr:last-child td {
    border-bottom: none;
}

.quotation-container {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    width: 100%;
}

.quotation-form {
    width: 100%;
    max-width: 1000px;
    min-width: 0;
}

.quotation-preview {
    flex: 0 0 calc(40% - 24px);
    background: #e5e7eb;
    padding: 12px;
    border-radius: 8px;
    overflow: auto;
    max-height: 900px;
}

.quotation-preview-modal {
    background: #e5e7eb;
    padding: 10px;
    border-radius: 8px;
    overflow: auto;
    max-height: 80vh;
}

.quotation-sheet {
    width: 100%;
    max-width: 260mm;
    min-height: auto;
    background: #fff;
    padding: 8mm 10mm;
    border: 1px solid #ccc;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: Arial, Helvetica, sans-serif;
}

.quotation-sheet h1 {
    font-size: 22px;
    margin: 0 0 16px;
    color: #1f2937;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 8px;
}

.quotation-sheet h3 {
    font-size: 16px;
    margin: 16px 0 8px;
    color: #374151;
}

.quotation-sheet .meta {
    margin: 10px 0;
    font-size: 14px;
    color: #4b5563;
}

.quotation-sheet .meta strong {
    color: #1f2937;
    display: inline-block;
    min-width: 80px;
}

.quotation-sheet .total {
    font-size: 20px;
    font-weight: 700;
    text-align: right;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid #e5e7eb;
    color: #2563eb;
}

.quotation-sheet table.line-items th {
    font-size: 12px;
    font-weight: 600;
    background: #f9fafb;
}

.quotation-sheet table.line-items td,
.quotation-sheet table.line-items th {
    border: 1px solid #e5e7eb;
}

.totals-summary table th {
    font-weight: 600;
}

.totals-summary table td {
    font-size: 13px;
}

.quotation-sheet .quotation-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.quotation-sheet .quotation-header .logo {
    max-height: 60px;
    object-fit: contain;
}

.quotation-sheet .quotation-header h1 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0 0 4px;
}

.quotation-sheet .status-line {
    font-size: 12px;
    color: #374151;
    background: #eef2ff;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.quotation-sheet .company-block {
    margin: 8px 0 4px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.quotation-sheet .description {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 12px;
    border-radius: 4px;
    min-height: 80px;
}

.table a {
    color: #FF8249;
    text-decoration: none;
    margin-right: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.table a:hover {
    color: #AE1607;
    text-decoration: none;
}

.table .btn-delete {
    margin-left: 4px;
}

/* ========================================
   STILI UNIFORMI PER TUTTI I BOTTONI
   ======================================== */

/* Classe per hover gradiente su bottoni con sfondo chiaro */
.btn-hover-gradient {
    transition: all 0.2s ease !important;
}
.btn-hover-gradient:hover {
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* Bottoni BASE - Stili comuni */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Bottone DETTAGLIO/VISUALIZZA - Blu */
.btn-detail,
.btn.btn-primary,
.btn-sm.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.btn-detail:hover,
.btn.btn-primary:hover,
.btn-sm.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Versione small per bottoni dettaglio */
.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
}

/* Bottone ELIMINA - Rosso */
.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-delete:hover,
.btn-delete:focus {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-delete:active {
    transform: translateY(0);
}

.data-table .btn-delete,
.table .btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-delete.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-delete.btn-compact {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
    line-height: 1;
}

/* Bottone NUOVO/CREATE - Verde */
.btn-new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-new:hover,
.btn-new:focus {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-new:active {
    transform: translateY(0);
}

.btn-new .icon-plus {
    font-size: 16px;
    vertical-align: middle;
}

/* Bottone SUCCESS/SALVA - Verde scuro */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Bottone SECONDARY/RESET - Grigio */
.btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    color: #fff;
    border-color: transparent;
}

/* Icone nei bottoni */
.btn .icon-trash,
.btn-delete .icon-trash {
    font-size: 14px;
}

/* Link MODIFICA/EDIT nelle tabelle */
.table a.btn-edit,
.table a:not(.btn):not(.btn-delete):not(.btn-detail) {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-block;
}

.table a.btn-edit:hover,
.table a:not(.btn):not(.btn-delete):not(.btn-detail):hover {
    color: #2563eb;
    background: #dbeafe;
    text-decoration: none;
}

/* Bottoni speciali per funzionalità specifiche */
.btn-preview {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-preview:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-upload {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-comment {
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-comment:hover {
    background: linear-gradient(135deg, #D9581F 0%, #8B0E05 100%);
}

.actions {
    margin: 16px 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-form input,
.inline-form select {
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    height: 42px;
    box-sizing: border-box;
}

.inline-form input:focus,
.inline-form select:focus {
    outline: none;
    border-color: #FF8249;
    box-shadow: 0 0 0 3px rgba(255, 130, 73, 0.1);
}

.inline-form button,
.inline-form .btn {
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    color: #fff;
    border: 0;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(255, 130, 73, 0.2);
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.inline-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 130, 73, 0.3);
}

.inline-form button:active {
    transform: translateY(0);
}

form label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

form input,
form textarea,
form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 0;
    transition: all 0.2s;
}

form input:focus,
form textarea:focus,
form select:focus {
    outline: none;
    border-color: #FF8249;
    box-shadow: 0 0 0 3px rgba(255, 130, 73, 0.1);
}

form textarea {
    resize: vertical;
    min-height: 120px;
}

form button {
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    color: #fff;
    border: 0;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(255, 130, 73, 0.2);
}

form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 130, 73, 0.3);
}

form button:active {
    transform: translateY(0);
}

.alert {
    background: #dbeafe;
    padding: 14px 18px;
    border-left: 4px solid #3b82f6;
    margin: 16px 0;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.alert.error {
    background: #fee2e2;
    border-left-color: #ef4444;
    color: #991b1b;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

.status-badge,
.stage-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-badge.status-open,
.status-badge.status-new {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.status-badge.status-qualified {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.status-badge.status-contacted,
.status-badge.status-active {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.status-badge.status-planned,
.status-badge.status-todo {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #6b21a8;
}

.status-badge.status-in_progress {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #831843;
}

.status-badge.status-closed {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #374151;
}

.stage-badge.stage-prospecting {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.stage-badge.stage-qualification {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.stage-badge.stage-proposal {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.stage-badge.stage-negotiation {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #831843;
}

.stage-badge.stage-closed_won {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.stage-badge.stage-closed_lost {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.auth {
    max-width: 360px !important;
    margin: 80px auto;
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
}

.auth h2 {
    text-align: center;
    margin-top: 0;
    font-size: 22px;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth label {
    font-size: 13px;
}

.auth input {
    padding: 10px 12px;
    font-size: 14px;
}

.auth button {
    padding: 10px 16px;
    font-size: 14px;
}

.footer {
    margin-top: 48px;
    padding-top: 24px;
    color: #9ca3af;
    text-align: center;
    font-size: 13px;
    border-top: 1px solid #e5e7eb;
}

/* ========================================
   MOBILE RESPONSIVE - Super Mobile First
   ======================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 130, 73, 0.4);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Overlay for mobile menu */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .container {
        max-width: 1400px;
    }
}

/* Desktop (1024px - 1199px) */
@media (max-width: 1199px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Landscape (768px - 1023px) */
@media (max-width: 1023px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        width: 200px;
    }
    
    .main {
        margin-left: 200px;
        padding: 16px;
    }
    
    .sidebar-footer {
        width: 168px;
    }
    
    .inline-form input,
    .inline-form select {
        flex: 1;
        min-width: 120px;
    }
}

/* Tablet Portrait & Large Mobile (600px - 767px) */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 1001;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-footer {
        width: 248px;
    }
    
    .main {
        margin-left: 0;
        padding: 70px 12px 12px 12px;
    }
    
    .topbar {
        height: auto;
        padding: 12px 16px;
        margin-bottom: 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .topbar h1 {
        font-size: 16px;
        flex: 1;
    }
    
    /* Global Search Mobile */
    .global-search {
        order: 3;
        width: 100%;
        margin-top: 8px;
    }
    
    #globalSearchInput {
        width: 100% !important;
        max-width: 100%;
        font-size: 14px;
    }
    
    #globalSearchInput:focus {
        width: 100% !important;
    }
    
    #globalSearchInput kbd {
        display: none; /* Hide keyboard shortcut on mobile */
    }
    
    #searchResults {
        width: calc(100vw - 32px);
        max-height: 60vh;
        left: 0;
        right: 0;
        margin: 0 auto;
    }
    
    .search-result-item {
        padding: 14px 16px;
        min-height: 48px; /* Touch target accessibility */
    }
    
    .search-result-item i {
        font-size: 18px;
        width: 24px;
        min-width: 24px;
    }
    
    .quick-access-item {
        padding: 14px 16px;
        min-height: 48px; /* Touch target accessibility */
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card h3 {
        font-size: 13px;
    }
    
    .card p {
        font-size: 22px;
    }
    
    /* Table Responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    .table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    /* Forms Responsive */
    .inline-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .inline-form input,
    .inline-form select,
    .inline-form button {
        width: 100%;
        min-width: unset;
    }
    
    /* Quotation Page */
    .quotation-container {
        display: block;
    }
    
    .quotation-form {
        width: 100%;
    }
    
    .quotation-preview-modal {
        max-height: 60vh;
    }
    
    .quotation-sheet {
        width: 100%;
        min-height: auto;
        padding: 16px;
        transform: scale(0.65);
        transform-origin: top center;
    }
    
    /* Auth Page */
    .auth {
        margin: 20px;
        padding: 24px;
    }
    
    /* Kanban Responsive */
    .kanban-board {
        flex-direction: column;
    }
    
    .kanban-column {
        min-width: unset;
        width: 100%;
    }
    
    /* Stats Cards Row */
    .stats-row, 
    .row {
        flex-direction: column;
    }
    
    .stats-row > div,
    .row > div {
        width: 100%;
    }
}

/* Mobile Small (480px - 599px) */
@media (max-width: 599px) {
    .main {
        padding: 65px 8px 8px 8px;
    }
    
    .topbar {
        padding: 10px 12px;
        border-radius: 8px;
    }
    
    .topbar h1 {
        font-size: 14px;
    }
    
    .card {
        padding: 14px;
        border-radius: 10px;
    }
    
    .card h3 {
        font-size: 12px;
    }
    
    .card p {
        font-size: 20px;
    }
    
    .table {
        font-size: 11px;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
    }
    
    /* Buttons */
    .btn, button {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    /* Form inputs */
    input, select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 12px;
    }
    
    /* Modal responsive */
    .custom-modal-content,
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none !important;
    }
    
    /* Action buttons stack */
    .action-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px;
        font-size: 13px;
        border-radius: 8px;
    }
}

/* Extra Small Mobile (< 480px) */
@media (max-width: 479px) {
    .mobile-menu-toggle {
        top: 8px;
        left: 8px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .main {
        padding: 60px 6px 6px 6px;
    }
    
    .sidebar {
        width: 260px;
    }
    
    .sidebar-footer {
        width: 228px;
    }
    
    .sidebar nav a {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .card p {
        font-size: 18px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    /* Compact table for very small screens */
    .table {
        font-size: 10px;
    }
    
    .table th,
    .table td {
        padding: 6px 4px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .sidebar nav a {
        padding: 14px 16px;
        min-height: 48px;
    }
    
    button, .btn, a.btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    input, select, textarea {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .sidebar nav a:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        padding: 12px;
    }
    
    .sidebar nav a {
        padding: 8px 12px;
    }
    
    .sidebar-footer {
        position: relative;
        bottom: auto;
        margin-top: 20px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .topbar,
    .sidebar-overlay {
        display: none !important;
    }
    
    .main {
        margin: 0;
        padding: 0;
    }
}

/* Utility classes for responsive */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

/* Scrollable table wrapper */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Mobile-friendly spacing */
.mb-mobile {
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .mb-mobile {
        margin-bottom: 0;
    }
}

/* Mobile Expense Cards */
.mobile-expense-cards {
    display: none;
}

.expense-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.expense-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.expense-card-id {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.expense-card-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.expense-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expense-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.expense-card-label {
    color: #6b7280;
    font-size: 12px;
}

.expense-card-value {
    font-weight: 500;
    color: #1f2937;
}

.expense-card-amount {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
}

.expense-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.expense-card-actions a,
.expense-card-actions button {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Mobile view - Show cards, hide table */
@media (max-width: 767px) {
    .mobile-expense-cards {
        display: block;
    }
    
    .expenses-table {
        display: none;
    }
    
    /* Generic table responsive */
    .data-table-wrapper {
        display: none;
    }
    
    .mobile-cards-view {
        display: block;
    }
}

/* Desktop view - Show table, hide cards */
@media (min-width: 768px) {
    .mobile-expense-cards {
        display: none !important;
    }
    
    .expenses-table {
        display: table;
    }
}

/* Invoice/Contract mobile cards */
.mobile-data-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.mobile-data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-data-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-data-card-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.mobile-data-card-label {
    color: #6b7280;
    font-size: 12px;
    flex-shrink: 0;
}

.mobile-data-card-value {
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.mobile-data-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.mobile-data-card-actions a,
.mobile-data-card-actions button {
    flex: 1;
    min-width: 70px;
    text-align: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

/* Page Headers Responsive */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
}

/* KPI Grid Responsive */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.kpi-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

/* Filter bar responsive */
.filter-bar {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: flex-end;
}

.filter-form select,
.filter-form input {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    min-width: 140px;
}

/* Filter buttons alignment */
.filter-form .btn,
.filter-form button {
    height: 38px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 13px;
    width: auto;
    justify-self: start;
}

/* Filter grid layout (used in expenses, etc) */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-grid label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
}

.filter-grid select,
.filter-grid input[type="text"],
.filter-grid input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    height: 42px;
    box-sizing: border-box;
}

.filter-grid .btn,
.filter-grid button[type="submit"] {
    height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin-top: auto;
}

/* Mobile Specific Styles */
@media (max-width: 767px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .page-header > div {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    .page-header > div a,
    .page-header > div button {
        flex: 1;
        text-align: center;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .kpi-card {
        padding: 12px;
    }
    
    .kpi-label {
        font-size: 10px;
    }
    
    .kpi-value {
        font-size: 18px;
    }
    
    .filter-bar {
        padding: 12px;
    }
    
    .filter-form {
        gap: 8px;
    }
    
    .filter-form select,
    .filter-form input {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 100%;
        flex: 1;
    }
    
    .btn-new {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .kpi-label {
        margin-bottom: 0;
    }
}

/* Topbar User Info */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 767px) {
    .topbar-user span {
        display: none;
    }
    
    .topbar-user {
        padding: 0 !important;
        background: transparent !important;
    }
    
    .topbar-user a {
        padding: 8px 10px !important;
    }
}

@media (max-width: 500px) {
    .topbar h1 {
        font-size: 14px !important;
    }
}

/* ============================================
   PWA & Mobile App Styles
   ============================================ */

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.mobile-bottom-nav .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6b7280;
    padding: 8px 4px;
    flex: 1;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-bottom-nav .bottom-nav-item .nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.mobile-bottom-nav .bottom-nav-item .nav-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-bottom-nav .bottom-nav-item.active {
    color: #FF8249;
}

.mobile-bottom-nav .bottom-nav-item.active .nav-icon {
    transform: scale(1.15);
}

.mobile-bottom-nav .bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    border-radius: 0 0 3px 3px;
}

.mobile-bottom-nav .bottom-nav-item:active {
    transform: scale(0.95);
}

/* Connection Status Indicator */
.connection-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1003;
    animation: fadeIn 0.3s ease;
}

.connection-indicator.online {
    background: #d4edda;
    color: #155724;
}

.connection-indicator.offline {
    background: #f8d7da;
    color: #721c24;
}

/* Pull to Refresh Indicator */
#pullRefreshIndicator {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1004;
    font-size: 14px;
    color: #FF8249;
}

/* Touch-friendly enhancements */
@media (max-width: 767px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Add padding to main content for bottom nav */
    .main {
        padding-bottom: 80px !important;
    }
    
    /* Larger touch targets */
    .btn, button, .action-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Table rows touch-friendly */
    .data-table td {
        padding: 14px 12px;
    }
    
    /* Cards touch-friendly */
    .card, .task-item, .ticket-row {
        touch-action: pan-x pan-y;
    }
    
    /* Form inputs touch-friendly */
    input, select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    
    /* Hide sidebar completely in mobile app mode */
    @media (display-mode: standalone) {
        .sidebar {
            display: none !important;
        }
        
        .main {
            margin-left: 0 !important;
        }
        
        .mobile-menu-toggle {
            display: block !important;
        }
        
        /* Safe area insets for notched devices */
        .topbar {
            padding-top: env(safe-area-inset-top);
        }
        
        .mobile-bottom-nav {
            padding-bottom: calc(8px + env(safe-area-inset-bottom));
        }
    }
}

/* Standalone app mode specific styles */
@media (display-mode: standalone) {
    .mobile-bottom-nav {
        display: flex !important;
    }
    
    .main {
        padding-bottom: 80px !important;
    }
    
    /* Remove URL bar space */
    html, body {
        overscroll-behavior: none;
    }
}

/* iOS Safari specific */
@supports (-webkit-touch-callout: none) {
    .mobile-bottom-nav {
        padding-bottom: calc(8px + 20px); /* Extra padding for home indicator */
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: #1f2937;
    }
    
    .mobile-bottom-nav .bottom-nav-item {
        color: #9ca3af;
    }
    
    .mobile-bottom-nav .bottom-nav-item.active {
        color: #FF8249;
    }
}

/* Swipe actions for lists */
.swipeable-row {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.swipe-actions {
    position: absolute;
    right: -80px;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    transition: right 0.2s ease;
}

.swipeable-row.swiped .swipe-actions {
    right: 0;
}

/* Loading states for offline */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Floating Action Button (FAB) for mobile */
.fab {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8249 0%, #AE1607 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 130, 73, 0.4);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 130, 73, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

@media (max-width: 767px) {
    .fab {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========================================
   UTILITY CLASSES & NEW COMPONENTS
   ======================================== */

/* Spacing Utilities */
.mt-2 { margin-top: 8px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-8 { margin-top: 32px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-8 { margin-bottom: 32px !important; }
.p-4 { padding: 16px !important; }
.p-8 { padding: 32px !important; }

/* Flexbox Utilities */
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.gap-2 { gap: 8px !important; }
.gap-4 { gap: 16px !important; }

/* Text Utilities */
.text-center { text-align: center !important; }
.text-white { color: #fff !important; }
.text-gray { color: #6b7280 !important; }
.text-sm { font-size: 14px !important; }
.text-xs { font-size: 12px !important; }
.font-bold { font-weight: 700 !important; }

/* Card Variants */
.card-gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
}
.card-gradient-green h3,
.card-gradient-green p,
.card-gradient-green .big-number {
    color: #fff !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

.card-gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
}
.card-gradient-blue h3,
.card-gradient-blue p,
.card-gradient-blue .big-number {
    color: #fff !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

/* Generic Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: #f3f4f6;
    color: #374151;
}

/* Code Block */
.code-block {
    display: block;
    background: #1f2937;
    color: #10b981;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

/* ========================================
   DASHBOARD STYLES
   ======================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.green::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card.amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.pink::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.stat-card.red::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.1;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.chart-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.mini-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.mini-chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pipeline-bar {
    display: flex;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.pipeline-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s;
}

.pipeline-segment:hover {
    flex-grow: 1.2 !important;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 13px;
    color: #374151;
}

.activity-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-value {
        font-size: 22px;
    }
    .stat-card {
        padding: 16px;
    }
    .mini-chart-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s;
    background: #f9fafb;
    height: 42px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #FF8249;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 130, 73, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Note: .inline-form is now defined earlier in the file with proper alignment */
