/* === Z-Net Hub 2026 Design === */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-card: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.15);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(255, 255, 255, 0.12);
    --success: #00ff88;
    --danger: #ff4466;
    --warning: #ffcc00;
    --info: #00aaff;
    --glow-sm: 0 0 10px rgba(255, 255, 255, 0.1);
    --glow-md: 0 0 20px rgba(255, 255, 255, 0.15);
    --glow-lg: 0 0 30px rgba(255, 255, 255, 0.2);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

#app {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.hidden {
    display: none !important;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* === LOGIN SCREEN === */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    animation: ambientGlow 15s ease-in-out infinite;
}

@keyframes ambientGlow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(2%, 2%) rotate(180deg); }
}

.login-header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

.logo {
    width: 88px;
    height: 88px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 24px;
    box-shadow: var(--glow-md);
    letter-spacing: -1px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

#login-form,
#application-form {
    background: var(--bg-secondary);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--glow-sm);
    position: relative;
    z-index: 1;
}

/* Все кнопки внутри login/welcome/application контейнеров поверх ::before */
.login-container > button,
.login-container > .error-message,
.welcome-container > .welcome-buttons {
    position: relative;
    z-index: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
}

.error-message {
    background: rgba(255, 68, 102, 0.1);
    border: 1px solid rgba(255, 68, 102, 0.2);
    color: var(--danger);
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

/* === BUTTONS === */
.btn {
    padding: 16px 28px;
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--glow-sm);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--glow-md);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-glow);
}

.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(255, 68, 102, 0.1);
    box-shadow: 0 0 20px rgba(255, 68, 102, 0.2);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 12px 18px;
    font-size: 13px;
}

/* === HEADER === */
.header {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    letter-spacing: -0.3px;
}

.back-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--glow-sm);
}

/* === CONTENT === */
.content {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px;
    overflow-y: auto;
}

/* === MENU GRID === */
.menu-grid {
    display: grid;
    gap: 12px;
}

.menu-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: left;
    color: var(--text-primary);
}

.menu-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
    transform: translateY(-2px);
}

.menu-item:active {
    transform: translateY(0);
}

.menu-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--glow-sm);
    font-size: 18px;
}

.menu-icon.green,
.menu-icon.red,
.menu-icon.yellow,
.menu-icon.purple,
.menu-icon.blue {
    border-color: var(--border-glow);
    color: var(--text-primary);
    box-shadow: var(--glow-sm);
}

.menu-text h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.menu-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
}

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

.card-title {
    font-size: 17px;
    font-weight: 600;
}

.card-badge {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--glow-sm);
}

/* === LIST === */
.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.list-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.list-item-arrow {
    color: var(--text-muted);
}

/* === SOCIAL NETWORKS === */
.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.social-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.social-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
    transform: translateY(-2px);
}

.social-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 1px solid var(--border-glow);
    box-shadow: var(--glow-sm);
}

.social-icon.google {
    background: linear-gradient(135deg, #EA4335 0%, #FBBC05 50%, #34A853 100%);
    color: white;
    border-color: rgba(234, 67, 53, 0.3);
}
.social-icon.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
    border-color: rgba(225, 48, 108, 0.3);
}
.social-icon.tiktok {
    background: linear-gradient(135deg, #00f2ea, #ff0050);
    color: white;
    border-color: rgba(0, 242, 234, 0.3);
}

.social-name {
    font-weight: 500;
    font-size: 14px;
}

/* === ACCOUNT CARD === */
.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 12px;
}

.account-field {
    margin-bottom: 18px;
}

.account-field:last-child {
    margin-bottom: 0;
}

.account-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.account-value {
    font-size: 15px;
    font-family: 'SF Mono', Monaco, monospace;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: var(--radius-xs);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    transition: var(--transition);
    border-radius: 6px;
}

.copy-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* === BOTTOM NAV === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-notif-dot {
    position: absolute;
    top: -3px;
    right: -5px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid var(--bg-primary);
    box-shadow: 0 0 6px rgba(255, 68, 102, 0.7);
    animation: pulseDot 2s ease-in-out infinite;
}

/* === MODAL === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 18px 22px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.modal-footer .btn {
    flex: 1;
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1100;
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--glow-md);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* === LOADING === */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: var(--glow-sm);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 50px 24px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    opacity: 0.4;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
}

/* === SECTION === */
.section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-left: 4px;
}

/* === HISTORY === */
.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
}

.history-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.history-title {
    font-weight: 500;
}

.history-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* === ADMIN SECTION === */
.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--glow-sm);
}

.admin-section h3 {
    margin-bottom: 5px;
    font-weight: 600;
}

.admin-section p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* === MEMBER LIST === */
.member-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
}

.member-item:hover {
    border-color: var(--border-glow);
}

.member-avatar {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 500;
}

.member-role {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-glow);
    color: var(--text-primary);
    box-shadow: var(--glow-sm);
}

.icon-btn.danger:hover {
    border-color: rgba(255, 68, 102, 0.3);
    color: var(--danger);
    box-shadow: 0 0 15px rgba(255, 68, 102, 0.15);
}

/* === LINK ITEMS === */
.link-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.link-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
}

.link-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    color: var(--text-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-sm);
}

.link-text {
    flex: 1;
    font-weight: 500;
}

.link-arrow {
    color: var(--text-muted);
}

/* === CATEGORY ITEMS === */
.category-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.category-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
    transform: translateX(4px);
}

.category-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    box-shadow: var(--glow-sm);
}

.category-name {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
}

.category-arrow {
    color: var(--text-muted);
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 18px;
}

.pagination-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-btn:not(:disabled):hover {
    background: var(--bg-secondary);
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* === CONFIRMATION === */
.confirm-box {
    text-align: center;
    padding: 24px;
}

.confirm-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    background: rgba(255, 68, 102, 0.1);
    border: 1px solid rgba(255, 68, 102, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
}

.confirm-text {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 17px;
}

.confirm-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}

/* === TABS === */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.tab {
    padding: 12px 22px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tab:hover {
    border-color: var(--border-glow);
}

.tab.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: var(--glow-sm);
}

/* === MESSAGE IMAGES === */
.message-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.message-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.message-image:hover {
    border-color: var(--border-glow);
    box-shadow: var(--glow-sm);
}

/* === IMAGE UPLOAD === */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 16px;
}

.image-upload-area:hover {
    border-color: var(--border-glow);
    background: var(--bg-tertiary);
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-color);
}

.image-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* === WELCOME SCREEN === */
.welcome-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.welcome-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    animation: ambientGlow 15s ease-in-out infinite;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.welcome-apply-btn {
    position: relative;
}

.welcome-apply-arrow {
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 4px;
    margin-bottom: -2px;
    animation: arrowBounce 1.5s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); opacity: 0.35; }
    50% { transform: translateY(-6px); opacity: 0.6; }
}

.welcome-apply-hint {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
    margin-top: 0;
}

/* === APPLICATION FORM === */
.input-readonly {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

/* === MANAGER CONTACT BUTTON === */
.manager-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-xs);
    color: var(--info);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin-top: 10px;
}

.manager-contact-btn:hover {
    background: rgba(0, 170, 255, 0.1);
    border-color: rgba(0, 170, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.15);
}

/* === APPLICATION CARDS === */
.application-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.application-card:hover {
    border-color: var(--border-glow);
}

.application-card .app-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

.application-card .app-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

.application-card .app-field-label {
    color: var(--text-secondary);
}

.application-card .app-field-value {
    color: var(--text-primary);
    font-weight: 500;
}

.application-card .app-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.app-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-status.pending {
    background: rgba(255, 204, 0, 0.1);
    color: var(--warning);
    border: 1px solid rgba(255, 204, 0, 0.2);
}

.app-status.processing {
    background: rgba(0, 170, 255, 0.1);
    color: var(--info);
    border: 1px solid rgba(0, 170, 255, 0.2);
}

.app-status.accepted {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.app-status.rejected {
    background: rgba(255, 68, 102, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 68, 102, 0.2);
}

/* === MENU BUTTON NOTIFICATION HIGHLIGHT === */
.menu-item.menu-item-notify {
    border-color: rgba(255, 68, 102, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 68, 102, 0.2), 0 0 18px rgba(255, 68, 102, 0.12);
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 68, 102, 0.06));
    animation: menuNotifyPulse 3s ease-in-out infinite;
}

@keyframes menuNotifyPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255, 68, 102, 0.2), 0 0 18px rgba(255, 68, 102, 0.12); }
    50% { box-shadow: 0 0 0 1px rgba(255, 68, 102, 0.35), 0 0 26px rgba(255, 68, 102, 0.22); }
}

/* === NOTIFICATION DOT === */
.notif-dot {
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
    box-shadow: 0 0 8px rgba(255, 68, 102, 0.6);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.85; }
}

/* === UNREAD DOT (в списке сообщений истории) === */
.history-item-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.history-item-unread {
    border-color: rgba(255, 68, 102, 0.25) !important;
}

.msg-unread-dot {
    width: 9px;
    height: 9px;
    min-width: 9px;
    background: var(--danger);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(255, 68, 102, 0.6);
    animation: pulseDot 2s ease-in-out infinite;
}

/* === APPLICATION FILTER === */
.app-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.app-filter-btn {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 22px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.app-filter-btn:hover {
    border-color: var(--border-glow);
    color: var(--text-primary);
}

.app-filter-btn.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: var(--glow-sm);
}

.app-sub-filter {
    margin-top: -4px;
    margin-bottom: 14px;
    padding-left: 12px;
}

.app-sub-filter .app-filter-btn {
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 18px;
    opacity: 0.85;
}

/* === APPLICATION CARD HEADER === */
.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.app-menu-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.app-menu-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-glow);
    color: var(--text-primary);
}

/* === APPLICATION CONTEXT MENU === */
.app-ctx-menu {
    position: fixed;
    min-width: 180px;
    max-width: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), var(--glow-sm);
    z-index: 500;
    overflow: hidden;
    animation: ctxMenuIn 0.15s ease-out;
}

@keyframes ctxMenuIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-ctx-label {
    padding: 10px 14px 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.app-ctx-btn {
    display: block;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.app-ctx-btn:last-child {
    border-bottom: none;
}

.app-ctx-btn:hover {
    background: var(--bg-tertiary);
}

.app-ctx-empty {
    padding: 14px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* === APPLICATION ACTION BUTTONS === */
.app-action-btns {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.app-action-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.app-action-btn.accept {
    background: rgba(0, 255, 136, 0.08);
    border-color: rgba(0, 255, 136, 0.25);
    color: var(--success);
}

.app-action-btn.accept:hover {
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
}

.app-action-btn.reject {
    background: rgba(255, 68, 102, 0.08);
    border-color: rgba(255, 68, 102, 0.25);
    color: var(--danger);
}

.app-action-btn.reject:hover {
    background: rgba(255, 68, 102, 0.15);
    box-shadow: 0 0 12px rgba(255, 68, 102, 0.15);
}

/* === APPLICATION DEPARTMENT BADGE === */
.app-dept-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(0, 170, 255, 0.08);
    border: 1px solid rgba(0, 170, 255, 0.2);
    color: var(--info);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

/* === IMAGE VIEWER === */
.img-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: imgViewerIn 0.2s ease-out;
    cursor: pointer;
}

@keyframes imgViewerIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.img-viewer-container {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    cursor: default;
    animation: imgScaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes imgScaleIn {
    from { transform: scale(0.88); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.img-viewer-img {
    max-width: 100%;
    max-height: 88vh;
    border-radius: var(--radius-sm);
    object-fit: contain;
    display: block;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.img-viewer-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
    box-shadow: var(--glow-sm);
}

.img-viewer-close:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--glow-md);
}
