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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--tg-theme-bg-color, #f5f5f5);
    color: var(--tg-theme-text-color, #1a202c);
    line-height: 1.5;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    color: white;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.header p {
    opacity: 0.9;
    font-size: 13px;
}

.user-card {
    background: var(--tg-theme-secondary-bg-color, white);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s ease;
}

.user-avatar {
    font-size: 48px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
}

.user-username {
    font-size: 13px;
    opacity: 0.7;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge.admin {
    background: #fed7d7;
    color: #c53030;
}

.badge.main-admin {
    background: #fbb6ce;
    color: #9b2c2c;
}

.menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.menu-btn {
    background: var(--tg-theme-secondary-bg-color, white);
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    color: var(--tg-theme-text-color, #1a202c);
    transition: all 0.2s ease;
}

.menu-btn:active {
    transform: scale(0.96);
}

.card {
    background: var(--tg-theme-secondary-bg-color, white);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

textarea, input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: var(--tg-theme-bg-color, white);
    color: var(--tg-theme-text-color, #1a202c);
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus, input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #cbd5e0;
    color: #1a202c;
}

.btn-danger {
    background: #f56565;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.upload-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    margin-top: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.upload-btn:active {
    transform: scale(0.98);
    background: #38a169;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--tg-theme-secondary-bg-color, white);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:active {
    transform: scale(0.95);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

.request-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.request-item {
    background: var(--tg-theme-bg-color, #f7fafc);
    border-radius: 12px;
    padding: 14px;
    border-left: 4px solid #cbd5e0;
    cursor: pointer;
    transition: all 0.2s;
}

.request-item:active {
    transform: scale(0.98);
}

.request-item.pending { border-left-color: #ed8936; }
.request-item.approved { border-left-color: #48bb78; }
.request-item.published { border-left-color: #48bb78; }
.request-item.rejected { border-left-color: #f56565; }
.request-item.answered { border-left-color: #4299e1; }

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.request-id {
    font-weight: 600;
}

.request-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.05);
}

.request-text {
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.request-date {
    font-size: 10px;
    opacity: 0.5;
}

.media-area {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0,0,0,0.03);
    border-radius: 12px;
}

.media-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.media-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.media-preview-item img, .media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-media {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #e2e8f0;
    border-radius: 12px;
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tab.active {
    background: white;
    color: #667eea;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: var(--tg-theme-secondary-bg-color, white);
    border-radius: 20px;
    padding: 20px;
    max-width: 90%;
    width: 340px;
    max-height: 80%;
    overflow-y: auto;
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    opacity: 0.6;
}

.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.loading {
    text-align: center;
    padding: 60px;
}

.hidden {
    display: none;
}