/* /opt/alphabet_app_dev/static/marketing.css */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* ============ Header ============ */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(255,255,255,0.3);
}

/* ============ Platform Toggle ============ */
.platform-toggle {
    display: flex;
    justify-content: center;
    padding: 20px;
    gap: 0;
}

.platform-btn {
    padding: 12px 32px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.platform-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.platform-btn:last-child {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.platform-btn.active {
    background: #667eea;
    color: white;
}

.platform-btn:hover:not(.active) {
    background: #f0f3ff;
}

.platform-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============ Main Content ============ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

/* ============ Week Selector ============ */
.week-selector {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.week-selector label {
    font-weight: 500;
    color: #374151;
}

.week-selector select {
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 280px;
    cursor: pointer;
}

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

.btn-load {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load:hover {
    background: #5a67d8;
}

/* ============ Stats Cards ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.stat-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.stat-card .icon.purple { background: #f0e6ff; }
.stat-card .icon.blue { background: #e6f0ff; }
.stat-card .icon.green { background: #e6fff0; }
.stat-card .icon.orange { background: #fff3e6; }
.stat-card .icon.red { background: #ffe6e6; }
.stat-card .icon.cyan { background: #e6f7ff; }
.stat-card .icon.gray { background: #f3f4f6; }

.stat-card .label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-card .value.currency::after {
    content: ' ₽';
    font-size: 1.2rem;
    font-weight: 500;
    color: #6b7280;
}

.stat-card .value .percent {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
}

.stat-card .trend {
    font-size: 0.8rem;
    margin-top: 8px;
}

.stat-card .trend.up { color: #10b981; }
.stat-card .trend.down { color: #ef4444; }

/* ============ Chart Section ============ */
.chart-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chart-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* ============ Table Section ============ */
.table-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add:hover {
    background: #059669;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
}

.data-table tr:hover {
    background: #f9fafb;
}

.data-table .week-cell {
    font-weight: 600;
    color: #1f2937;
}

.data-table .money {
    color: #059669;
    font-weight: 500;
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon.edit {
    background: #e6f0ff;
    color: #3b82f6;
}

.btn-icon.edit:hover {
    background: #3b82f6;
    color: white;
}

.btn-icon.delete {
    background: #ffe6e6;
    color: #ef4444;
}

.btn-icon.delete:hover {
    background: #ef4444;
    color: white;
}

/* ============ Modal ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #6b7280;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-body {
    padding: 24px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

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

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

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    padding: 10px 20px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f9fafb;
}

.btn-save {
    padding: 10px 24px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-save:hover {
    background: #5a67d8;
}

/* ============ States ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1rem;
}

.no-access {
    text-align: center;
    padding: 100px 20px;
    color: #6b7280;
}

.no-access .icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-access h2 {
    color: #374151;
    margin-bottom: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ============ Period Toggle ============ */
.period-toggle {
    display: flex;
    gap: 0;
    margin-right: 16px;
}

.period-btn {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.period-btn:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.period-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.period-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-inputs input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
}

.period-inputs input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-separator {
    color: #9ca3af;
    font-size: 1.1rem;
}

/* ============ Utility ============ */
.hidden {
    display: none !important;
}
