* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
}

.app {
    max-width: 760px;
    margin: 0 auto;
    padding: 10px;
}

.header {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.header h1 {
    margin: 0 0 4px 0;
    font-size: 22px;
    line-height: 1.15;
}

.header p {
    margin: 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.3;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.header-user {
    font-size: 12px;
    color: #cbd5e1;
}

.logout-link {
    font-size: 12px;
    color: #93c5fd;
    text-decoration: none;
}

.tabs-card {
    margin-bottom: 10px;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    border: 1px solid #334155;
    background: #111827;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.tab-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 10px;
}

.compact-card {
    padding: 10px;
}

.block-title {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
}

.mini-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #cbd5e1;
}

textarea,
select,
input[type="file"],
.login-input {
    width: 100%;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0b1220;
    color: #e2e8f0;
    padding: 10px;
    font-size: 14px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

#userText {
    min-height: 120px;
}

#aiResponse {
    min-height: 180px;
}

.mini-status {
    margin-top: 6px;
    font-size: 12px;
    color: #93c5fd;
    line-height: 1.3;
    white-space: pre-wrap;
}

.btn {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn.primary {
    background: #2563eb;
    color: white;
}

.btn.success {
    background: #16a34a;
    color: white;
}

.btn.warning {
    background: #eab308;
    color: #111827;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.small-btn {
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 10px;
    background: #0b1220;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.tool-btn {
    min-width: 34px;
    height: 32px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0b1220;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 14px;
    padding: 0 8px;
}

.tool-btn:hover {
    background: #13203a;
}

.emoji-main-btn {
    font-size: 16px;
}

.emoji-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0b1220;
}

.hidden {
    display: none !important;
}

.emoji-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.emoji-btn:hover {
    background: #1d2b46;
}

.files-help {
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.files-preview {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
    background: #0b1220;
    border: 1px solid #334155;
}

.file-thumb {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 auto;
    background: #111827;
    border: 1px solid #243244;
}

.file-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    border: 1px solid #243244;
    font-size: 20px;
}

.file-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.file-name {
    font-size: 13px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.file-size {
    font-size: 11px;
    color: #94a3b8;
}

.file-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}

.file-action-btn {
    width: 30px;
    height: 28px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #111827;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.file-action-btn:hover {
    background: #1d2b46;
}

.admin-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 12px 0;
    font-size: 13px;
    color: #cbd5e1;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-card {
    background: #0b1220;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 10px;
}

.user-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.user-title {
    font-weight: 700;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #93c5fd;
}

.user-meta {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.user-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 8px 0 6px 0;
}

.channel-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.channel-chip {
    border: 1px solid #334155;
    background: #111827;
    color: #e2e8f0;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
}

.channel-pick-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow: auto;
    padding: 6px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #111827;
}

.channel-pick-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.user-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 640px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}