/* Общие стили для всех страниц WBozon */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    overflow-x: hidden;
}


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


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

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 100%);
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header h1 {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header p {
    opacity: 0.85;
    font-size: 0.75rem;
    margin: 0;
    font-weight: 400;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    position: relative;
    border: none;
    background: none;
    border-radius: 6px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: white;
    font-weight: 600;
}

.nav-links a.active::after {
    width: 100%;
    height: 3px;
    background: white;
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

.logout-btn {
    background: rgb(220, 53, 69);
    color: white;
    border: 1px solid rgb(220, 53, 69);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: 12px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.settings-btn {
    padding: 8px 16px;
    background: white;
    border: 1.5px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.settings-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.settings-btn:active {
    transform: translateY(0);
}

.marketplace-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1.5px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.marketplace-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.marketplace-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Controls */
.controls {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid #e8e9ea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    animation: fadeInUp 0.5s ease 0.1s both;
}

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

.control-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    white-space: nowrap;
}

.control-group input[type="date"],
.control-group select {
    padding: 8px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.control-group input[type="date"]:hover,
.control-group select:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.control-group input[type="date"]:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: rgb(220, 53, 69);
    color: white;
}

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


/* Content */
.content {
    padding: 0px 20px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Container for all pages - make table fill remaining space */
.container {
    max-width: 100%;
    margin: 0;
    background: white;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    border: none;
    animation: fadeIn 0.5s ease;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.4s ease;
    flex-shrink: 0;
}

/* Stats section */
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e9ea;
    margin: 0;
    flex-shrink: 0;
}

.stat-item {
    flex: 1;
    min-width: 110px;
    padding: 12px 16px;
    text-align: center;
    border-right: 1px solid #e8e9ea;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.stat-item:last-child {
    border-right: none;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-item:hover::before {
    transform: scaleX(1);
}

.stat-item h3 {
    font-size: 0.6rem;
    margin: 0 0 4px 0;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.stat-item .value {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.stat-item.stat-danger .value {
    color: #dc3545;
}

.stat-item.stat-warning .value {
    color: #ff9800;
}

.stat-item.stat-primary .value {
    color: #28a745;
}


/* Table container - fill remaining space */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-top: 4px;
    flex: 1;
    position: relative;
    border: 1px solid #e0e0e0;
    background: white;
    animation: fadeInUp 0.6s ease 0.2s both;
    scroll-behavior: smooth;
    min-height: 0;
}

/* Scroll hint */
.scroll-hint {
    text-align: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border-radius: 8px;
    margin-bottom: 12px;
    color: #667eea;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    }
    50% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    }
}

.scroll-hint::before {
    content: "💡";
    font-size: 1.2rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Marketplace toggle */
.marketplace-toggle {
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 4px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.marketplace-toggle:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.marketplace-toggle .marketplace-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.marketplace-toggle .marketplace-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.marketplace-toggle .marketplace-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-top: 12px;
}

.pagination button {
    padding: 8px 16px;
    border: 1.5px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pagination button:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination span {
    padding: 6px 14px;
    font-weight: 600;
    color: #667eea;
    font-size: 0.85rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.2rem;
    color: #667eea;
    animation: fadeIn 0.5s ease;
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top: 4px solid #667eea;
    border-right: 4px solid #764ba2;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sync status */
.sync-status {
    padding: 12px 20px;
    margin: 12px 20px;
    border-radius: 6px;
    display: none;
    font-size: 0.85rem;
}

.sync-status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.sync-status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* Error */
.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    border-left: 4px solid #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0,0,0,0.9);
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    animation: fadeInTooltip 0.3s ease;
    pointer-events: none;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
    margin-bottom: -5px;
    z-index: 1000;
    animation: fadeInTooltip 0.3s ease;
    pointer-events: none;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .header {
        padding: 10px 16px;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .header p {
        font-size: 0.7rem;
    }

    .nav-links {
        gap: 12px;
        flex-wrap: wrap;
    }

    .nav-links a {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .controls {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
        margin-bottom: 8px;
    }

    .control-group input[type="date"],
    .control-group select {
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .settings-btn {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 8px;
    }

    .stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }

    .stat-item {
        border-right: 1px solid #e8e9ea;
        border-bottom: 1px solid #e8e9ea;
        min-width: auto;
        flex: none;
    }

    .stat-item:nth-child(2n) {
        border-right: none;
    }

    .stat-item:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .table-container,
    .table-wrapper {
        border-radius: 8px;
        margin-top: 4px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination button {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .marketplace-filter-btn {
        min-width: 100%;
    }

    .marketplace-toggle {
        width: 100%;
        flex-direction: column;
    }

    .marketplace-toggle .marketplace-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 8px 12px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
    }

    .header h1 {
        font-size: 1rem;
    }

    .header p {
        font-size: 0.65rem;
    }

    .content {
        padding: 8px 12px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 10px 8px;
    }

    .stat-item h3 {
        font-size: 0.55rem;
    }

    .stat-item .value {
        font-size: 0.9rem;
    }
}

