/* =====================================================
   DIKARSHINA — Shared Global CSS
   Единый источник стилей для всех страниц платформы.
   Содержит: переменные, шапку, лого-анимацию, user-pill.
   ===================================================== */

/* ── CSS Variables ── */
:root {
    --red:          #C0392B;
    --red-l:        #E74C3C;
    --red-grad:     linear-gradient(135deg, #C0392B, #E74C3C);
    --dark:         #262525;
    --bg:           #f5f5f5;
    --border:       #e5e7eb;
    --msg-mine-bg:  linear-gradient(135deg, #8B1A1A, #C0392B);
}

/* ── Header Accent Bar ── */
.header-accent,
.accent-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--red-l), #ff6b6b);
    flex-shrink: 0;
}

/* ── Header ── */
.header {
    background: var(--dark);
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .35);
    flex-shrink: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 12px;
}

/* ── Header Left & Right ── */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Контейнер для user-pill + logout — всегда flex */
#headerUser {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Logo ── */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    line-height: 0;
}

.logo-img {
    height: 38px;
    display: block;
    width: auto;
}

/* ── Page title after logo ── */
.header-title {
    color: rgba(255, 255, 255, .42);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .10em;
    white-space: nowrap;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, .12);
    margin-left: 4px;
}

/* ── Navigation links ── */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.header-nav a {
    color: rgba(255, 255, 255, .52);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 6px;
    transition: color .16s, background .16s;
    white-space: nowrap;
    letter-spacing: .01em;
}

.header-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.header-nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, .10);
}

/* ── Admin badge ── */
.admin-badge {
    background: rgba(192, 57, 43, .28);
    color: #ff8a80;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    flex-shrink: 0;
}

/* ── Company badge (chat/portal page) ── */
.company-badge {
    background: rgba(192, 57, 43, .18);
    color: rgba(255, 170, 150, .9);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

/* ── Login button (shown when not logged in) ── */
.btn-login {
    background: var(--red-grad);
    color: #fff;
    text-decoration: none;
    padding: 7px 18px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    transition: filter .16s, transform .16s;
    white-space: nowrap;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-login:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

/* ── Logout button ── */
.btn-logout {
    background: transparent;
    color: rgba(255, 255, 255, .52);
    border: 1px solid rgba(255, 255, 255, .16);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .16s;
    white-space: nowrap;
    font-family: inherit;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border-color: rgba(255, 255, 255, .32);
}

/* ── Logo Animation ── */
.logo-ink {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    cursor: pointer;
}

.logo-ink img {
    display: block;
    height: 38px;
    width: auto;
    position: relative;
    z-index: 1;
}

.logo-ink::after {
    content: "";
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: 2;
    background: linear-gradient(90deg,
        transparent 0%, transparent 44%,
        #d71920 50%,
        transparent 56%, transparent 100%);
    background-size: 300% 100%;
    background-position: 100% 0;
    opacity: 0;
    will-change: background-position;
    -webkit-mask-image: url("https://dikarshina.club/wa-data/public/site/img/DIKAR%20-%20MIR.png");
    mask-image: url("https://dikarshina.club/wa-data/public/site/img/DIKAR%20-%20MIR.png");
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    mix-blend-mode: screen;
    transition: opacity .12s ease;
}

.logo-ink.sweep::after {
    opacity: 1;
    animation: logo-sweep 1.6s linear;
}

@keyframes logo-sweep {
    from { background-position: 100% 0; }
    to   { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .logo-ink.sweep::after { animation: none; opacity: 0; }
}

/* ── User Pill ── */
.user-pill {
    background: rgba(192, 57, 43, .18);
    border: 1px solid rgba(192, 57, 43, .30);
    border-radius: 30px;
    padding: 4px 13px 4px 4px;
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    transition: background .16s, border-color .16s;
    cursor: pointer;
    font-family: inherit;
}

.user-pill:hover {
    background: rgba(192, 57, 43, .32);
    border-color: rgba(192, 57, 43, .48);
}

.user-av {
    width: 28px;
    height: 28px;
    background: var(--red-grad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.user-id {
    color: rgba(255, 255, 255, .42);
    font-size: 10px;
    line-height: 1.2;
}

/* ── User Pill Arrow ── */
.user-pill-arrow {
    color: rgba(255, 255, 255, .45);
    font-size: 10px;
    margin-left: 2px;
    transition: transform .2s;
}

/* ── User Dropdown ── */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
    z-index: 999;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s, transform .16s, visibility .16s;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, color .12s;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.user-dropdown-logout {
    color: rgba(255, 120, 100, .8);
}

.user-dropdown-logout:hover {
    background: rgba(192, 57, 43, .15);
    color: #ff6b6b;
}

.user-dropdown-sep {
    height: 1px;
    background: rgba(255, 255, 255, .08);
    margin: 2px 0;
}

/* ── Notification Bell ── */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .55);
    transition: background .16s, color .16s, border-color .16s;
    flex-shrink: 0;
}

.notif-bell:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
    border-color: rgba(255, 255, 255, .36);
}

.notif-bell svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid var(--dark);
    pointer-events: none;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-height: 420px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
    z-index: 999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notif-dropdown-head {
    padding: 12px 16px 10px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, .42);
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    flex-shrink: 0;
}

.notif-list {
    overflow-y: auto;
    flex: 1;
}

.notif-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    transition: background .12s;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255, 255, 255, .04); }

.notif-dot {
    width: 8px;
    min-width: 8px;
    height: 8px;
    min-height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.notif-dot.info    { background: #3b82f6; }
.notif-dot.warning { background: #f59e0b; }
.notif-dot.success { background: #22c55e; }

.notif-item-body { flex: 1; min-width: 0; }

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 2px;
}

.notif-item-text {
    font-size: 12px;
    color: rgba(255, 255, 255, .52);
    line-height: 1.4;
    margin-bottom: 4px;
}

.notif-item-date {
    font-size: 10px;
    color: rgba(255, 255, 255, .28);
}

.notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: rgba(255, 255, 255, .28);
    font-size: 13px;
}

/* ── Password Toggle ── */
.pwd-wrap {
    position: relative;
}

.pwd-wrap .form-input {
    padding-right: 42px;
    margin-bottom: 0 !important;
}

.pwd-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: color .16s;
}

.pwd-toggle:hover {
    color: #6b7280;
}

.pwd-toggle svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .header-title { display: none; }
    .header-nav a { padding: 6px 8px; font-size: 12px; }
    .btn-login, .btn-logout { padding: 6px 12px; font-size: 12px; }
    .user-name { display: none; }
    .user-id { display: none; }
}
