* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    width: 100%;
}

.nav-left {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-right {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
    font-size: 0.95rem;
}

.nav a:hover {
    opacity: 0.8;
}

.upload-btn {
    background: white;
    color: #667eea;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.upload-btn:hover {
    transform: translateY(-2px);
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.2s;
    line-height: 1;
    min-width: 42px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.lang-btn.active {
    background: rgba(255,255,255,0.4);
    border-color: white;
    transform: scale(1.15);
}

.user-name {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.search-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    background: #667eea;
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #5568d3;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.7rem 1.2rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.documents-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.doc-item {
    display: flex;
    align-items: center;
    padding: 1.2rem;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}

.doc-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.doc-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    margin-right: 1rem;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #2c3e50;
    word-wrap: break-word;
}

.doc-meta {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.doc-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.doc-action {
    padding: 0.6rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.view-btn {
    background: #e8eef7;
    color: #667eea;
}

.view-btn:hover {
    background: #667eea;
    color: white;
}

.download-btn {
    background: #e8f5e9;
    color: #4caf50;
}

.download-btn:hover {
    background: #4caf50;
    color: white;
}

.edit-btn {
    background: #fff3cd;
    color: #856404;
}

.edit-btn:hover {
    background: #ffc107;
    color: white;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
    color: white;
}

.news-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.news-item {
    padding: 1.2rem;
    border-left: 4px solid #667eea;
    background: #f8f9ff;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.news-item:hover {
    background: #f0f2ff;
    transform: translateX(5px);
}

.news-item img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.news-date {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.news-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.news-text {
    font-size: 0.9rem;
    color: #5a6c7d;
    line-height: 1.5;
}

.add-news-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s;
}

.add-news-btn:hover {
    transform: translateY(-2px);
}

.stats {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.viewer-content {
    max-width: 90%;
    width: 90%;
    max-height: 90vh;
    padding: 0;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
}

.viewer-body {
    height: calc(90vh - 100px);
    padding: 1rem;
}

.viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #2c3e50;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #667eea;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn {
    background: #667eea;
    color: white;
}

.save-btn:hover {
    background: #5568d3;
}

.cancel-btn {
    background: #e1e8ed;
    color: #2c3e50;
}

.cancel-btn:hover {
    background: #d0d7de;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e1e8ed;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.pagination-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .nav-left, .nav-right {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .doc-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .doc-actions {
        width: 100%;
        margin-top: 1rem;
    }

    .doc-action {
        flex: 1;
        min-width: 44px;
        font-size: 1.2rem;
    }

    .container {
        padding: 1rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .modal-content {
        padding: 1rem;
    }

    .viewer-content {
        max-width: 95%;
        width: 95%;
    }
    
    .user-name {
        font-size: 0.85rem;
        padding: 0.2rem 0.6rem;
    }
    
    .language-switcher {
        justify-content: center;
    }
}

