/* ============================================================
   ОСНОВНЫЕ СТИЛИ - DASHBOARD С БОКОВЫМ МЕНЮ
   ============================================================ */

/* ----- СБРОС И БАЗА ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0d0d1a;
    color: #e0e0e0;
}

body {
    display: flex;
    min-height: 100vh;
}

/* ----- ОСНОВНОЙ КОНТЕЙНЕР ----- */
.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============================================================
   БОКОВОЕ МЕНЮ (SIDEBAR)
   ============================================================ */

.sidebar {
    width: 240px;
    background: #141425;
    border-right: 1px solid #1e1e3a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 25px 20px 20px 20px;
    border-bottom: 1px solid #1e1e3a;
}

.sidebar-logo a {
    font-size: 24px;
    font-weight: 800;
    color: #4ecca3;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo a span {
    color: #e94560;
}

.sidebar-logo .sub {
    font-size: 11px;
    color: #555;
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

.sidebar-menu {
    flex: 1;
    padding: 15px 0;
}

.sidebar-menu .menu-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #444;
    letter-spacing: 1.5px;
    padding: 10px 20px 6px 20px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #8888aa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    color: #ffffff;
    background: rgba(78, 204, 163, 0.05);
}

.sidebar-menu a.active {
    color: #4ecca3;
    background: rgba(78, 204, 163, 0.08);
    border-left-color: #4ecca3;
}

.sidebar-menu a .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-menu a .badge {
    margin-left: auto;
    background: #e94560;
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.sidebar-menu a .balance-badge {
    margin-left: auto;
    color: #f5a623;
    font-weight: 600;
    font-size: 13px;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #1e1e3a;
    font-size: 12px;
    color: #444;
}

/* ============================================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================================ */

.main-content {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
    min-width: 0;
}

/* ----- ШАПКА КОНТЕНТА ----- */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #e0e0e0;
}

.content-header h1 small {
    font-size: 14px;
    font-weight: 400;
    color: #666;
    display: block;
    margin-top: 2px;
}

.content-header .user-info {
    font-size: 14px;
    color: #8888aa;
    background: #141425;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #1e1e3a;
}

/* ============================================================
   КАРТОЧКИ СТАТИСТИКИ
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.stat-card {
    background: #141425;
    border: 1px solid #1e1e3a;
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #2a2a4e;
}

.stat-card .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 4px;
}

.stat-card .stat-value.green { color: #4ecca3; }
.stat-card .stat-value.gold { color: #f5a623; }
.stat-card .stat-value.pink { color: #e94560; }
.stat-card .stat-value.blue { color: #8be9fd; }
.stat-card .stat-value.purple { color: #b388ff; }

/* ============================================================
   УВЕДОМЛЕНИЯ
   ============================================================ */

.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert.success {
    background: rgba(78, 204, 163, 0.10);
    border-color: #4ecca3;
    color: #4ecca3;
}

.alert.error {
    background: rgba(233, 69, 96, 0.10);
    border-color: #e94560;
    color: #e94560;
}

.alert.warning {
    background: rgba(245, 166, 35, 0.10);
    border-color: #f5a623;
    color: #f5a623;
}

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */

.table-wrap {
    background: #141425;
    border: 1px solid #1e1e3a;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 15px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    background: #0d0d1a;
    color: #8888aa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #1e1e3a;
}

.table td {
    padding: 10px 16px;
    border-bottom: 1px solid #181830;
    color: #c8c8d8;
}

.table tr:hover td {
    background: rgba(78, 204, 163, 0.03);
}

.table .status {
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.table .status.active,
.table .status.completed { background: rgba(78, 204, 163, 0.15); color: #4ecca3; }
.table .status.pending { background: rgba(245, 166, 35, 0.15); color: #f5a623; }
.table .status.failed,
.table .status.rejected { background: rgba(233, 69, 96, 0.15); color: #e94560; }
.table .status.paused { background: rgba(139, 233, 253, 0.15); color: #8be9fd; }

/* ============================================================
   ФОРМЫ
   ============================================================ */

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #8888aa;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: #0d0d1a;
    border: 1px solid #1e1e3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4ecca3;
}

.form-group input::placeholder {
    color: #444;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    background: #1e1e3a;
    color: #c8c8d8;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #4ecca3;
    color: #0d0d1a;
}
.btn-primary:hover {
    background: #3db892;
}

.btn-danger {
    background: #e94560;
    color: #fff;
}
.btn-danger:hover {
    background: #d13a54;
}

.btn-success {
    background: #4ecca3;
    color: #0d0d1a;
}
.btn-success:hover {
    background: #3db892;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================================================
   АВТОРИЗАЦИЯ (центрированная)
   ============================================================ */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0d0d1a;
}

.auth-box {
    background: #141425;
    border: 1px solid #1e1e3a;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.auth-box .logo {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: #4ecca3;
    margin-bottom: 30px;
}

.auth-box .logo span {
    color: #e94560;
}

.auth-box h2 {
    text-align: center;
    color: #e0e0e0;
    font-size: 20px;
    margin-bottom: 5px;
}

.auth-box .sub {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
}

.auth-box .form-group {
    margin-bottom: 18px;
}

.auth-box .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 16px;
}

.auth-box .footer-text {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #666;
}

.auth-box .footer-text a {
    color: #4ecca3;
    text-decoration: none;
}

.auth-box .footer-text a:hover {
    text-decoration: underline;
}

/* ============================================================
   СТРАНИЦА ПРОСМОТРА РЕКЛАМЫ
   ============================================================ */

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 15px;
}

.ad-card {
    background: #141425;
    border: 1px solid #1e1e3a;
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ad-card:hover {
    border-color: #4ecca3;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.ad-card .ad-name {
    font-weight: 600;
    font-size: 15px;
    color: #e0e0e0;
}

.ad-card .ad-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
}

.ad-card .ad-meta .timer {
    color: #8be9fd;
}

.ad-card .ad-meta .price {
    color: #4ecca3;
    font-weight: 600;
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */

@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .app-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #1e1e3a;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px 15px;
        gap: 5px;
    }
    
    .sidebar-logo {
        padding: 5px 0;
        border-bottom: none;
        width: 100%;
    }
    
    .sidebar-logo a {
        font-size: 20px;
    }
    
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
        padding: 5px 0;
        width: 100%;
    }
    
    .sidebar-menu .menu-label {
        display: none;
    }
    
    .sidebar-menu a {
        padding: 6px 12px;
        font-size: 13px;
        border-left: none;
        border-radius: 6px;
    }
    
    .sidebar-menu a .icon {
        font-size: 16px;
        width: 20px;
    }
    
    .sidebar-menu a .balance-badge {
        font-size: 12px;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .content-header h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        padding: 25px;
        margin: 15px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar-menu a {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .main-content {
        padding: 12px;
    }
}