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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Стеклянная карточка */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 30px;
}

/* Тулбар */
.toolbar {
    margin-bottom: 20px;
}

.add-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #00d2ff, #3a7bd5);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 210, 255, 0.6);
}

.add-btn span {
    font-size: 20px;
}

/* Таблица */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 16px 20px;
    text-align: left;
}

th {
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

th:first-child {
    border-radius: 12px 0 0 12px;
}

th:last-child {
    border-radius: 0 12px 12px 0;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

td.loading,
td.empty,
td.error {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

td.error {
    color: #ff4757;
}

td.description {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Статус */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status.active {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.status.paused {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status.stopped {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

/* Тип канала */
.channel-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(138, 43, 226, 0.2);
    color: #b366ff;
}

/* Ссылка */
.url-link {
    color: #00d2ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.url-link:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

/* Бюджет */
.budget {
    font-weight: 600;
    color: #2ed573;
}

/* Действия */
.actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.action-btn.edit {
    background: rgba(0, 210, 255, 0.15);
}

.action-btn.edit:hover {
    background: rgba(0, 210, 255, 0.3);
    transform: scale(1.1);
}

.action-btn.delete {
    background: rgba(255, 71, 87, 0.15);
}

.action-btn.delete:hover {
    background: rgba(255, 71, 87, 0.3);
    transform: scale(1.1);
}

/* Модальное окно */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 71, 87, 0.3);
    color: #ff4757;
}

.modal-body {
    padding: 30px;
}

/* Форма */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00d2ff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: #1a1a2e;
    color: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Кнопки формы */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-cancel,
.btn-save {
    flex: 1;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-save {
    background: linear-gradient(135deg, #00d2ff, #3a7bd5);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 210, 255, 0.6);
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .glass-card {
        padding: 15px;
        border-radius: 16px;
    }
    
    th, td {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal {
        border-radius: 16px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
}
