/* ===== MODERN WEB APPLICATION FRAMEWORK CSS ===== */

/* === RESET & BASE === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* === LAYOUT SYSTEM === */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.main-content {
    margin-left: 280px;
    padding: 30px;
    flex: 1;
    background-color: #f8fafc;
    min-height: 100vh;
}

/* === SIDEBAR NAVIGATION === */
.nav-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.nav-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.nav-header .subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.nav-menu {
    padding: 20px 0;
}

.nav-item {
    margin: 5px 15px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateX(5px);
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-separator {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 20px 15px;
}

/* === CONTENT COMPONENTS === */
.page-header {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.page-title {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.page-subtitle {
    color: #7f8c8d;
    font-size: 16px;
}

/* === CARDS & CONTAINERS === */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #ecf0f1;
    background: #fafbfc;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.card-body {
    padding: 25px;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.btn-secondary {
    background: #ecf0f1;
    color: #7f8c8d;
}

/* === TABLES === */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

.data-table tr:nth-child(even) {
    background-color: #fafbfc;
}

/* === SUMMARY SECTIONS === */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.summary-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8fafc, #ecf0f1);
    border-bottom: 1px solid #e1e8ed;
    cursor: pointer;
    transition: all 0.3s ease;
}

.summary-header:hover {
    background: linear-gradient(135deg, #ecf0f1, #dae1e7);
}

.summary-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.summary-body {
    max-height: 400px;
    overflow-y: auto;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;

    overflow-x: auto;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;

}

.summary-table th {
    background: #f8fafc;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #5a6c7d;
    border-bottom: 2px solid #e1e8ed;
}

.summary-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f4f7;
    font-size: 14px;
}

.summary-table .clickable-cell {
    color: #3498db;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.summary-table .clickable-cell:hover {
    color: #2980b9;
    background-color: #f0f8ff;
}

.total-row {
    background: linear-gradient(135deg, #e8f4f8, #d5eaf2) !important;
    font-weight: 700;
    color: #2c3e50;
}

/* === ALERTS & NOTIFICATIONS === */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

/* === LOADING STATES === */
.loading {
    text-align: center;
    padding: 50px 20px;
    color: #7f8c8d;
}

.loading i {
    font-size: 24px;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === FILTER INFO === */
.filter-info {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.filter-text {
    font-weight: 500;
    color: #155724;
}

/* === LOG SECTIONS === */
.log-section {
    background: #2c3e50;
    color: #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    height: 600px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.log-entry.error {
    color: #e74c3c;
    font-weight: bold;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 24px;
    }
}


/*过滤筛选条件 按钮风格，发票导入*/
 .form-group {
            margin-bottom: 25px;
        }

        .form-label {
            display: block;
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 8px;
        }

        .form-input {
            width: 100%;
            padding: 15px 20px;
            border: 2px solid #ecf0f1;
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s ease;
            background: #f8fafc;
            box-sizing: border-box;
        }

        .form-input:focus {
            outline: none;
            border-color: #3498db;
            background: white;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
        }

        /*filter style*/

        .filter-section {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 4px;
            padding: 15px;
            margin-top: 10px;
        }

        .filter-section h4 {
            margin-top: 0;
            color: #495057;
            font-size: 14px;
        }

        .filter-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            align-items: center;
        }

        .filter-input {
            flex: 1;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .filter-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }

        .filter-item {
            background: #e9ecef;
            border: 1px solid #ced4da;
            border-radius: 4px;
            padding: 6px 12px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-right: 5px;
            margin-bottom: 5px;
        }

        .filter-item:hover {
            background: #dee2e6;
            border-color: #adb5bd;
        }

        .filter-item.selected {
            background: #007bff;
            color: white;
            border-color: #0056b3;
        }

        .filter-item .delete-btn {
            background: #dc3545;
            color: white;
            border: none;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            font-size: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s ease;
        }

        .filter-item .delete-btn:hover {
            background: #c82333;
        }

   /*>>> for sales, sites, fixSales*/

     body {
            font-family: Arial, sans-serif;
            margin: 20px;
            background-color: #f5f5f5;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

button {
   padding: 8px 16px;
            background: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
}

        h1 {
            color: #333;
            text-align: center;
            margin-bottom: 30px;
        }

       /*search bar */
        .search-bar {
            margin-bottom: 20px;
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .search-bar input {
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            flex: 1;
        }

        .search-bar button {
            padding: 8px 16px;
            background: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .search-bar button:hover {
            background: #0056b3;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }

        th, td {
            padding: 12px 8px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }

        th {
            background-color: #f8f9fa;
            font-weight: bold;
            color: #333;
        }

        tr:hover {
            background-color: #f8f9fa;
        }

        .amount-input, .sale-range-input, .priority-input{
            width: 100px;
            padding: 4px 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            text-align: right;
            box-sizing: border-box;
        }

        .amount-display, .sale-range-display, .sales-display {
            display: inline-block;
            width: 100px;
            text-align: right;
            padding: 4px 8px;
            box-sizing: border-box;
        }

        .sale-range-input, .sales-input{
            text-align: left;
        }

        .sale-range-display {
            text-align: left;
        }

        .btn-edit, .btn-save, .btn-cancel {
            padding: 4px 8px;
            margin: 0 2px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }

        .btn-edit {
            background: #28a745;
            color: white;
        }

        .btn-save {
            background: #007bff;
            color: white;
        }

        .btn-cancel {
            background: #6c757d;
            color: white;
        }

        .btn-edit:hover { background: #218838; }
        .btn-save:hover { background: #0056b3; }
        .btn-cancel:hover { background: #545b62; }

        .status-active {
            color: #28a745;
            font-weight: bold;
        }

        .status-inactive {
            color: #dc3545;
        }

        .loading {
            text-align: center;
            padding: 20px;
            color: #666;
        }
/*modal style*/
.inbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(2px); /* 添加背景模糊效果 */
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    margin: 50px auto;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); /* 增强阴影效果 */
    animation: modalFadeIn 0.3s ease-out; /* 添加淡入动画 */
}

.modal-header {
    padding: 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    height: calc(100% - 70px);
    overflow-y: auto;
    padding: 20px;
}

.modal-close-btn {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease; /* 添加颜色过渡效果 */
}

.modal-close-btn:hover {
    color: #000; /* 悬停时颜色变深 */
}

/* 添加模态框淡入动画 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 90%;
        margin: 20px auto;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-body {
        padding: 15px;
        height: calc(100% - 60px);
    }
}


/*pager*/

   .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 20px;
        }
        .pagination button {
            padding: 8px 16px;
            border: 1px solid #ddd;
            background: white;
            cursor: pointer;
              color: black;
            border-radius: 4px;
        }
        .pagination button:hover {
            background: #f5f5f5;
        }
        .pagination button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .pagination .current {
            padding: 8px 16px;
            background: #1976d2;
            color: white;
            border-radius: 4px;
        }

/*message style*/

.error {
            text-align: center;
            padding: 50px;
            color: #d32f2f;
            background-color: #ffebee;
            margin: 20px;
            border-radius: 4px;
        }

        .success {
            color: #28a745;
            text-align: center;
            padding: 10px;
        }

        .summary-section {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 15px 20px;
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .summary-item {
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            padding: 8px 12px;
            border-radius: 6px;
        }

        .summary-item:hover {
            background: #e9ecef;
            transform: translateY(-2px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .summary-item:active {
            transform: translateY(0);
        }

        .summary-item.active {
            background: #007bff;
        }

        .summary-item.active .summary-label,
        .summary-item.active .summary-value {
            color: white;
        }

        .summary-label {
            font-size: 14px;
            color: #6c757d;
            margin-bottom: 5px;
        }

        .summary-value {
            font-size: 24px;
            font-weight: bold;
            color: #007bff;
        }

        /*<<<< for sales, sites, fixSales*/

/*progress bar */
  .progress-bar-container {
            width: 100%;
            height: 20px;
            background-color: #e9ecef;
            border-radius: 10px;
            overflow: hidden;
            position: relative;
        }
        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #007bff 0%, #28a745 100%);
            width: 0%;
            transition: width 0.3s ease;
            position: relative;
            border-radius: 10px;
        }
        .progress-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #333;
            font-size: 12px;
            font-weight: bold;
            z-index: 1;
        }

/*search section */
 .search-section {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 25px;
            border: 1px solid #e9ecef;
        }
        .search-title {
            font-size: 18px;
            font-weight: bold;
            color: #333;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }
        .search-title::before {
            content: "🔍";
            margin-right: 8px;
        }
        .search-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }
        .search-field {
            display: flex;
            flex-direction: column;
        }
        .search-field label {
            font-weight: 500;
            margin-bottom: 5px;
            color: #555;
            font-size: 14px;
        }
        .search-field input, .search-field select {
            padding: 10px;
            border: 1px solid #ced4da;
            border-radius: 5px;
            font-size: 14px;
            transition: border-color 0.3s;
        }
        .search-field input:focus, .search-field select:focus {
            outline: none;
            border-color: #007bff;
            box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
        }
        .search-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
