:root {
    --primary: #4318ff;
    --bg-main: #f4f7fe;
    --sidebar-dark: #111c44;
    --text-dark: #2b3674;
    --text-gray: #a3aed0;
    --white: #ffffff;
    --border: #e0e5f2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-dark);
    color: white;
    padding: 30px 0;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 0 30px 40px;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tree-menu {
    flex: 1;
    overflow-y: auto;
}

.tree-item {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #b0bbd8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tree-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.03);
}

.tree-item.active {
    color: white;
}

.tree-item .arrow {
    font-size: 10px;
    width: 12px;
    transition: transform 0.2s;
}

.tree-sub-items {
    padding-left: 15px;
    background: rgba(0, 0, 0, 0.15);
}

.tree-item.sub {
    font-size: 13.5px;
    padding: 10px 25px;
}

.active-sub {
    color: var(--primary) !important;
    font-weight: 600;
    background: rgba(67, 24, 255, 0.1);
}

.sidebar-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: #a3aed0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    background: var(--white);
    border-radius: 30px;
    padding: 10px 18px;
    width: 380px;
    display: flex;
    align-items: center;
    box-shadow: 14px 17px 40px 4px rgba(112, 144, 176, 0.05);
}

.search-box input {
    border: none;
    outline: none;
    margin-left: 10px;
    width: 100%;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.content-body {
    padding: 0 30px 30px;
    flex: 1;
    overflow-y: auto;
}

.table-header {
    margin-bottom: 20px;
}

.table-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.table-header small {
    color: var(--text-gray);
    font-weight: 400;
}

/* Table */
.table-card {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.02);
}

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

th {
    text-align: left;
    padding: 12px 15px;
    color: var(--text-gray);
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 15px;
    border-bottom: 1px solid #f8f9fa;
    font-size: 14px;
}

tr.selected {
    background-color: #f7f9ff;
}

.device-name {
    font-weight: 600;
}

.type-badge {
    background: #f4f7fe;
    color: var(--primary);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

/* --- Ячейки с копированием --- */
.copy-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: #a3aed0;
    padding: 3px 5px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    font-size: 13px;
    flex-shrink: 0;
}

.btn-copy:hover {
    color: #4318ff;
    background: #f0eeff;
}

.btn-copy.copied {
    color: #01b574;
}

/* --- Пароль --- */
.password-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.password-wrapper .btn-eye {
    background: none;
    border: none;
    cursor: pointer;
    color: #a3aed0;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 13px;
    transition: color 0.2s, background 0.2s;
}

.password-wrapper .btn-eye:hover {
    color: #4318ff;
    background: #f0eeff;
}

/* --- Адрес как ссылка --- */
.address-link {
    color: #4318ff;
    text-decoration: none;
    font-size: 13px;
}

.address-link:hover {
    text-decoration: underline;
}

/* --- Тост-уведомление --- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1b2559;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast i {
    color: #01b574;
}

.comment-text {
    color: var(--text-gray);
    font-size: 13px;
}

.actions-col {
    text-align: right;
    color: var(--text-gray);
    cursor: pointer;
}