* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Header Styles */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: #6ea78c;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.user-section {
    color: #ecf0f1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Main Content */
.main-content {
    display: flex;
    min-height: calc(100vh - 80px);
    padding: 20px;
    background: #1e1e2e;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h2 {
    color: #000000;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.demo-login-btn {
    width: 100%;
    margin-top: 10px;
    padding: 0.9rem 1rem;
    border: 1px solid #89b4fa;
    border-radius: 8px;
    background: transparent;
    color: #89b4fa;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.demo-login-btn:hover {
    background: #89b4fa;
    color: #1e1e2e;
}

/* System Info Styles */
.system-info-section {
    margin-bottom: 2rem;
}

.system-info-section h3 {
    color: #cdd6f4;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.system-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.system-card {
    background: #181825;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #89b4fa;
}

.system-card h4 {
    color: #89b4fa;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.system-card div {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #cdd6f4;
}

.system-card p {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.system-card .label {
    font-weight: 600;
    color: #6c7086;
}

.system-card .value {
    color: #cdd6f4;
}

/* Progress bars for usage */
.usage-bar {
    background-color: #313244;
    border-radius: 10px;
    height: 8px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.usage-fill.cpu {
    background: linear-gradient(90deg, #89b4fa, #89b4fa);
}

.usage-fill.memory {
    background: linear-gradient(90deg, #f38ba8, #f38ba8);
}

/* Users Management Styles */
.users-section {
    margin-bottom: 2rem;
}

.users-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.stat-item {
    background: #181825;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #cdd6f4;
}

.users-controls {
    background: #181825;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #313244;
    border-radius: 4px;
    background: #11111b;
    color: #cdd6f4;
}

.search-box input::placeholder {
    color: #6c7086;
}

.users-list {
    background: #181825;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.users-list table {
    width: 100%;
    border-collapse: collapse;
}

.users-list th,
.users-list td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #313244;
    color: #cdd6f4;
}

.users-list th {
    background: #11111b;
    font-weight: 600;
    color: #89b4fa;
}

.users-list tr:hover {
    background-color: #313244;
}

.status-active {
    color: #a6e3a1;
    font-weight: bold;
}

.status-expired {
    color: #f38ba8;
    font-weight: bold;
}

/* Modal Windows */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #1e1e2e;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    color: #cdd6f4;
}

.modal-content h3 {
    color: #89b4fa;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c7086;
}

.close:hover {
    color: #f38ba8;
}

.modal input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #313244;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #11111b;
    color: #cdd6f4;
}

/* File management */
.file-management-card {
    background: #181825;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #313244;
}

.file-management-card h4 {
    color: #89b4fa;
    margin-bottom: 1rem;
}

.upload-area {
    border: 2px dashed #313244;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.upload-area:hover {
    border-color: #89b4fa;
    background-color: #313244;
}

.upload-placeholder div {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-placeholder p {
    margin-bottom: 0.5rem;
    color: #6c7086;
}

.upload-placeholder small {
    color: #6c7086;
}

.upload-progress {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #313244;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #89b4fa, #89b4fa);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.file-info {
    background: #11111b;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #89b4fa;
    color: #cdd6f4;
}

.file-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.upload-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
}

.upload-status.success {
    background-color: #a6e3a144;
    color: #a6e3a1;
    border: 1px solid #a6e3a1;
}

.upload-status.error {
    background-color: #f38ba844;
    color: #f38ba8;
    border: 1px solid #f38ba8;
}

.upload-status.info {
    background-color: #89b4fa44;
    color: #89b4fa;
    border: 1px solid #89b4fa;
}

/* Termius-style main container */
.termius-container {
    display: flex;
    gap: 20px;
    min-height: 600px;
    background: #1e1e2e;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

.termius-sidebar {
    width: 280px;
    background: #181825;
    border-right: 1px solid #313244;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #313244;
}

.sidebar-header h3 {
    color: #cdd6f4;
    margin: 0;
    font-size: 14px;
}

.add-host-btn {
    background: #89b4fa;
    border: none;
    color: #1e1e2e;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.hosts-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.host-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.host-item:hover {
    background: #313244;
}

.host-item.selected {
    background: #89b4fa;
}

.host-item.selected .host-name,
.host-item.selected .host-address {
    color: #1e1e2e;
}

.host-icon {
    font-size: 24px;
    margin-right: 12px;
}

.host-info {
    flex: 1;
}

.host-name {
    font-weight: 600;
    color: #cdd6f4;
    font-size: 14px;
}

.host-address {
    font-size: 12px;
    color: #6c7086;
}

.host-delete {
    background: none;
    border: none;
    color: #6c7086;
    cursor: pointer;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.host-item:hover .host-delete {
    opacity: 1;
}

.host-delete:hover {
    color: #f38ba8;
}

.empty-hosts {
    text-align: center;
    padding: 40px 20px;
    color: #6c7086;
}

.btn-add-first {
    background: #89b4fa;
    border: none;
    color: #1e1e2e;
    padding: 8px 16px;
    border-radius: 8px;
    margin-top: 12px;
    cursor: pointer;
}

.termius-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #313244;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status.offline {
    background: #6c7086;
}

.status.online {
    background: #a6e3a1;
}

.status.connecting {
    background: #f9e2af;
    animation: pulse 1s infinite;
}

.status.error {
    background: #f38ba8;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    color: #cdd6f4;
    font-size: 14px;
}

.connect-btn, .disconnect-btn {
    background: #89b4fa;
    border: none;
    color: #1e1e2e;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.connect-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.disconnect-btn {
    background: #f38ba8;
}

.system-section h3, .users-section h3 {
    color: #cdd6f4;
    margin-bottom: 0;
    font-size: 16px;
}

.system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.refresh-btn {
    background: none;
    border: none;
    color: #89b4fa;
    cursor: pointer;
    font-size: 18px;
}

.terminal-btn {
    background: #89b4fa;
    border: none;
    color: #1e1e2e;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.terminal-btn:hover {
    background: #a6e3a1;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 10px;
    }

    .termius-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .termius-sidebar {
        width: 100%;
    }

    .termius-main {
        padding: 12px;
    }

    .system-header {
        align-items: stretch;
        flex-direction: column;
    }

    .terminal-btn {
        width: 100%;
        padding: 12px 16px;
    }
    
    .system-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .main-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .file-actions {
        flex-direction: column;
    }
    
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    .users-stats {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .users-list {
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .users-list table,
    .users-list thead,
    .users-list tbody,
    .users-list th,
    .users-list td,
    .users-list tr {
        display: block;
        width: 100%;
    }

    .users-list thead {
        display: none;
    }

    .users-list tr {
        background: #181825;
        border: 1px solid #313244;
        border-radius: 8px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    .users-list tr:hover {
        background: #181825;
    }

    .users-list td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 12px;
        border-bottom: 1px solid #313244;
        word-break: break-word;
    }

    .users-list td:last-child {
        border-bottom: 0;
    }

    .users-list td::before {
        min-width: 96px;
        color: #89b4fa;
        font-weight: 600;
        flex-shrink: 0;
    }

    .users-list td:nth-child(1)::before { content: "ID"; }
    .users-list td:nth-child(2)::before { content: "Имя"; }
    .users-list td:nth-child(3)::before { content: "Email"; }
    .users-list td:nth-child(4)::before { content: "Подписка"; }
    .users-list td:nth-child(5)::before { content: "Статус"; }
    .users-list td:nth-child(6)::before { content: "Действия"; }

    .users-list td .btn {
        width: 100%;
        max-width: 190px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #181825;
}

::-webkit-scrollbar-thumb {
    background: #313244;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #45475a;
}
/* ==================== СТИЛИ ДЛЯ СТРАНИЦЫ ВХОДА (TERMIUS STYLE) ==================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0a0a0f;
    padding: 20px;
}

.login-form {
    background: #1e1e2e;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    border: 1px solid #313244;
    transition: all 0.3s ease;
}

.login-form:hover {
    border-color: #89b4fa;
    box-shadow: 0 0 20px rgba(137, 180, 250, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #89b4fa;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #6c7086;
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cdd6f4;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #11111b;
    border: 1.5px solid #313244;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #cdd6f4;
    transition: all 0.2s ease;
    font-family: 'Segoe UI', 'Courier New', monospace;
}

.form-group input:focus {
    outline: none;
    border-color: #89b4fa;
    box-shadow: 0 0 0 3px rgba(137, 180, 250, 0.1);
}

.form-group input::placeholder {
    color: #45475a;
}

.login-btn {
    width: 100%;
    padding: 0.85rem;
    background: #89b4fa;
    color: #1e1e2e;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-family: 'Segoe UI', sans-serif;
}

.login-btn:hover {
    background: #a6e3a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(137, 180, 250, 0.2);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    padding-top: 1.25rem;
    border-top: 1px solid #313244;
}

.login-footer p {
    margin: 0;
    color: #6c7086;
    font-size: 0.7rem;
}

/* Privacy notice */
.privacy-notice {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #11111b;
    border-radius: 10px;
    border-left: 3px solid #89b4fa;
}

.privacy-notice p {
    margin: 0;
    font-size: 0.7rem;
    color: #6c7086;
    text-align: center;
}

.privacy-notice a {
    color: #89b4fa;
    text-decoration: none;
    transition: color 0.2s;
}

.privacy-notice a:hover {
    color: #a6e3a1;
    text-decoration: underline;
}

/* Error message */
.error-message {
    color: #f38ba8;
    text-align: center;
    margin: 1rem 0;
    padding: 0.75rem;
    background: rgba(243, 139, 168, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(243, 139, 168, 0.3);
    display: none;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Cookies notification - Termius style */
.cookies-notification {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
}

.cookies-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.cookies-text {
    flex: 1;
}

.cookies-text h3 {
    margin: 0 0 10px 0;
    color: #89b4fa;
    font-size: 1rem;
    font-weight: 600;
}

.cookies-text p {
    margin: 6px 0;
    color: #cdd6f4;
    font-size: 0.75rem;
    line-height: 1.4;
}

.cookies-text ul {
    margin: 8px 0;
    padding-left: 18px;
}

.cookies-text li {
    margin: 4px 0;
    color: #a6adc8;
    font-size: 0.7rem;
}

.cookies-small {
    font-size: 0.65rem !important;
    color: #6c7086 !important;
}

.cookies-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 90px;
}

.cookies-actions .btn {
    padding: 8px 12px;
    font-size: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cookies-actions .btn-primary {
    background: #89b4fa;
    border: none;
    color: #1e1e2e;
}

.cookies-actions .btn-primary:hover {
    background: #a6e3a1;
}

.cookies-actions .btn {
    background: #313244;
    border: none;
    color: #cdd6f4;
}

.cookies-actions .btn:hover {
    background: #45475a;
}

/* Privacy modal - Termius style */
#privacyModal .modal-content {
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: 16px;
    max-width: 650px;
}

#privacyModal .modal-content h2 {
    color: #89b4fa;
    font-size: 1.5rem;
}

.privacy-content h3 {
    color: #a6e3a1;
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #313244;
    padding-bottom: 0.5rem;
}

.privacy-content p, .privacy-content li {
    color: #cdd6f4;
    font-size: 0.85rem;
    line-height: 1.5;
}

.contact-info {
    background: #11111b;
    border-left: 3px solid #89b4fa;
}

.contact-info p {
    color: #a6adc8;
}

/* Responsive */
@media (max-width: 480px) {
    .login-form {
        padding: 1.75rem;
        margin: 10px;
        max-width: 95%;
    }
    
    .login-header h1 {
        font-size: 1.6rem;
    }
    
    .cookies-content {
        flex-direction: column;
    }
    
    .cookies-actions {
        flex-direction: row;
        justify-content: flex-end;
        width: 100%;
    }
    
    .cookies-notification {
        bottom: 10px;
        left: 5%;
        transform: none;
        width: 90%;
    }
}

/* Анимация для модального окна */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    animation: modalFadeIn 0.2s ease;
}

/* Стиль для ссылок */
a {
    color: #89b4fa;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #a6e3a1;
    text-decoration: underline;
}

/* Кастомный скролл для модального окна */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #11111b;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #313244;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #45475a;
}
