/* файл app-header.css */

/* Переключатель режимов в шапке */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.3rem 0.3rem 0.3rem 0.3rem;
    height: 4rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0 2rem 0 2rem;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.147);
}


.app-header h1 {
    font-size: 1.2rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.app-header p {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 400;
}

@media (max-width: 768px) {
    .app-header {
        margin-left: 3rem;
    }
}

.app-header .header-text {
    display: flex;
    flex: 1;
    align-items: center;
}


.app-header p {
    margin-bottom: 0;
}

.mode-switcher {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem;
    border-radius: 40px;
    backdrop-filter: blur(4px);
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: white;
    border: 1px solid transparent;
    /* max-width: 150px; */
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mode-btn.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mode-btn-main.active {
    color: var(--primary);
}

.mode-btn-partner.active {
    color: var(--primary);
}

.mode-btn-stats.active {
    color: var(--primary);
}

.mode-btn-finance-stats.active {
    color: var(--primary);
}

/* Адаптивность */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        text-align: center;
    }

    .mode-switcher {
        width: 100%;
        justify-content: center;
    }
}


/* Вкладки в модалке деталей */
.details-tabs {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: 1rem;
    background: var(--background-alt);
    padding: 0.25rem;
    border-radius: 40px;
}

.details-tabs .tab-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 30px 30px 8px 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--text-muted);
}

.details-tabs .tab-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.details-tabs .tab-btn.active {
    background: var(--gradient-primary-button);
    border-color: var(--primary-button);
    color: white;
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-header {
        flex-wrap: wrap;
    }

    .details-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
}

/* ========== КАССА (ОПЕРАЦИИ) ========== */

.operations-header {
    display: flex;
    justify-content: start;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.operations-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap; /* запрещает перенос текста */
}

.date-range {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    width: 330px;
}

.date-range input[type="date"] {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: 'Nunito', sans-serif;
}

.operations-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.summary-card .summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.summary-card .summary-values {
    display: flex;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.summary-card .amount-usd {
    color: var(--success);
}

.summary-card .amount-rub {
    color: #174099;
    /* color: var(--primary); */
}

.mode-btn-operations.active {
    color: var(--primary);
}

#operationsTable td:last-child {
    white-space: nowrap;
}

#operationsTable .space-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#operationsTable {
    min-width: 1000px;
}

#operationsTable th {
    background: var(--background-alt);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#operationsTable td {
    padding: 0.5rem 0.75rem;
}

#addOperationBtn {
    margin-bottom: 1rem;
}

.action-bar {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 0.5rem;
    margin: 1rem 1rem 0 4.1rem;
}

.notificationBadge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Адаптивность */
@media (max-width: 768px) {
    .operations-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .operations-summary {
        grid-template-columns: 1fr 1fr;
    }

    .date-range {
        width: 100%;
        flex-wrap: wrap;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    font-size: 0.85rem;
}

.user-avatar {
    font-size: 1rem;
}

.user-name {
    font-weight: 600;
    color: white;
}

.user-role {
    color: rgb(237, 237, 237);
    font-size: 0.75rem;
}

/* Логотип системы */
.logo {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 800;
    /* transform: rotate(-90deg); */
    color: #2563eb;               /* основной синий */
    background: #eff6ff;          /* светлый фон для контраста */
    padding: 0.1rem 0.4rem;
    border-radius: 0.5rem;
    line-height: 1;
    margin-right: 0.4rem;
    user-select: none;
}

/* Название компании в хедере (уже было) */
.company-name-header {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 400;
    color: #efefef;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border);
    white-space: nowrap;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.company-name-header:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.4rem;
        padding: 0.05rem 0.3rem;
        margin-right: 0.2rem;
    }
    .company-name-header {
        font-size: 0.7rem;
        margin-left: 0.4rem;
        padding-left: 0.4rem;
    }
}