:root {
    --bg: #4b4f5a;
    --card: #262a33;
    --text: #f5f7fa;
    --muted: #9aa3b2;
    --accent: #2f9bff;
    --field: #32363f;
    --field-border: #3d424d;
    --danger: #ff5470;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--text);
    padding: 24px;
    overflow-x: hidden;
}

/* --- Параллакс-фон на внутренних страницах --- */
.bg-parallax {
    display: none;
    position: fixed;
    inset: -60px;
    z-index: 0;
    background: url('bg.jpg') center/cover no-repeat;
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
    transition: transform .5s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
    pointer-events: none;
}

.bg-parallax::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(24, 27, 34, .55), rgba(24, 27, 34, .8));
}

body.page-photo .bg-parallax { display: block; }

/* --- Светлячки --- */
.particles {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particles span {
    position: absolute;
    bottom: -12px;
    border-radius: 50%;
    background: rgba(47, 155, 255, .85);
    filter: blur(1px);
    box-shadow: 0 0 8px rgba(47, 155, 255, .8);
    animation: float-up linear infinite;
}

@keyframes float-up {
    0%   { transform: translateY(0) translateX(0); }
    50%  { transform: translateY(-55vh) translateX(30px); }
    100% { transform: translateY(-110vh) translateX(-20px); }
}

/* --- Карточка --- */
.card {
    position: relative;
    z-index: 2;
    width: min(1000px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--card);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    animation: card-in .8s cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(28px) scale(.96); }
}

body.page-photo .card {
    background: rgba(38, 42, 51, .72);
    backdrop-filter: blur(12px);
}

.card.single {
    grid-template-columns: 1fr;
    min-height: 480px;
}

.card-left {
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
}

.card.single .card-left {
    align-items: center;
    text-align: center;
}

.card-right {
    background: linear-gradient(rgba(38, 42, 51, .25), rgba(38, 42, 51, .55)),
                url('bg.jpg') center/cover no-repeat;
}

/* --- Логотип --- */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
}

.logo-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    animation: pulse 2.4s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(47, 155, 255, .55); }
    70%  { box-shadow: 0 0 0 14px rgba(47, 155, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 155, 255, 0); }
}

.accent { color: var(--accent); }

.form-wrap {
    margin: auto 0;
    max-width: 420px;
    width: 100%;
}

.card.single .form-wrap { margin: auto; }

.form-wrap.wide { max-width: 720px; }

.widgets-wrap { max-width: 980px; }

.kicker {
    letter-spacing: .12em;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 12px;
    animation: fade-down .7s .1s both;
}

@keyframes fade-down {
    from { opacity: 0; transform: translateY(-10px); }
}

/* --- Заголовок с переливом --- */
h1 {
    font-size: 40px;
    margin: 0 0 8px;
    font-weight: 800;
    background: linear-gradient(120deg, #f5f7fa 0%, #f5f7fa 42%, #7cc4ff 50%, #f5f7fa 58%, #f5f7fa 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine 6s linear infinite, fade-down .7s .15s both;
}

@keyframes shine {
    to { background-position: -250% 0; }
}

.subtitle {
    color: var(--muted);
    animation: fade-down .7s .25s both;
}

/* --- Форма входа --- */
.input-group { margin-bottom: 16px; animation: fade-down .6s both; }
.input-group:nth-of-type(1) { animation-delay: .2s; }
.input-group:nth-of-type(2) { animation-delay: .3s; }

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--field-border);
    background: var(--field);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 155, 255, .25);
    transform: translateY(-1px);
}

.btn-primary {
    margin-top: 8px;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter .2s, transform .15s, box-shadow .2s;
    animation: fade-down .6s .4s both;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 8px 24px rgba(47, 155, 255, .35);
    transform: translateY(-2px);
}

.btn-primary:active { transform: translateY(1px); }

.error {
    color: var(--danger);
    font-size: 14px;
    margin: 4px 0 8px;
    animation: shake .4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.logout-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    padding: 10px 22px;
    border-radius: 999px;
    background: rgba(38, 42, 51, .7);
    backdrop-filter: blur(6px);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, .15);
    transition: background .2s, transform .2s, box-shadow .2s;
    animation: fade-down .7s .3s both;
}

.logout-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(47, 155, 255, .35);
}

/* --- Кнопки разделов --- */
.nav-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 28px;
}

.nav-btn {
    padding: 18px 12px;
    border-radius: 16px;
    background: var(--field);
    border: 1px solid var(--field-border);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
    animation: pop-in .6s cubic-bezier(.22, .61, .36, 1) both;
}

.nav-btn:nth-child(1) { animation-delay: .25s; }
.nav-btn:nth-child(2) { animation-delay: .35s; }
.nav-btn:nth-child(3) { animation-delay: .45s; }

.nav-btn:hover {
    border-color: var(--accent);
    background: #3a3f4a;
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(47, 155, 255, .25);
}

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

/* --- Виджеты статуса --- */
.widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 20px;
    margin-top: 32px;
}

.widget {
    text-align: center;
    animation: pop-in .6s cubic-bezier(.22, .61, .36, 1) both;
}

.widget:nth-child(1) { animation-delay: .10s; }
.widget:nth-child(2) { animation-delay: .18s; }
.widget:nth-child(3) { animation-delay: .26s; }
.widget:nth-child(4) { animation-delay: .34s; }
.widget:nth-child(5) { animation-delay: .42s; }
.widget:nth-child(6) { animation-delay: .50s; }
.widget:nth-child(7) { animation-delay: .58s; }
.widget:nth-child(8) { animation-delay: .66s; }

@keyframes pop-in {
    from { opacity: 0; transform: translateY(18px) scale(.9); }
}

.ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    transition: transform .3s;
}

.widget:hover .ring { transform: scale(1.07); }

.ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg { fill: none; stroke: var(--field); stroke-width: 10; }

.ring-fg {
    fill: none;
    stroke: var(--accent);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset .6s ease;
    filter: drop-shadow(0 0 6px rgba(47, 155, 255, .55));
}

.ring--temp .ring-fg { stroke: #ff8a4c; filter: drop-shadow(0 0 6px rgba(255, 138, 76, .55)); }
.ring--net .ring-fg  { stroke: #35d0a5; filter: drop-shadow(0 0 6px rgba(53, 208, 165, .55)); }
.ring--out .ring-fg  { stroke: #ffc857; filter: drop-shadow(0 0 6px rgba(255, 200, 87, .55)); }

.ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-value .num {
    font-size: 22px;
    font-weight: 800;
}

.ring-value small {
    color: var(--muted);
    font-size: 10px;
    margin-top: 2px;
    max-width: 90px;
}

.widget-label {
    margin-top: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

/* --- Адаптивность --- */
@media (max-width: 900px) {
    .widgets { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .card { grid-template-columns: 1fr; min-height: auto; }
    .card-right { display: none; }
    .card-left { padding: 40px 28px 48px; }
}

@media (max-width: 640px) {
    .nav-buttons { grid-template-columns: 1fr; }
}

/* --- Уважение к настройкам системы --- */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
/* --- Страница "Система" --- */
.system-wrap { max-width: 900px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; justify-content: center; }
.tab-btn { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--field-border); background: var(--field); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; transition: all .2s; }
.tab-btn.active, .tab-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-content { display: none; text-align: left; background: rgba(20, 23, 30, .55); border: 1px solid var(--field-border); border-radius: 16px; padding: 20px; animation: pop-in .4s both; }
.tab-content.active { display: block; }
.tab-content h3 { margin: 0 0 12px; font-size: 16px; }
.service-item, .dns-item, .mac-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--field); margin-bottom: 8px; font-size: 14px; }
.service-item span:first-child, .dns-item span:first-child, .mac-item span:first-child { flex: 1; word-break: break-all; text-align: left; }
.service-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.service-status.active { background: rgba(53, 208, 165, .15); color: #35d0a5; }
.service-status.inactive { background: rgba(255, 84, 112, .15); color: var(--danger); }
.tab-content button { padding: 8px 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.tab-content textarea { width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--field-border); border-radius: 12px; padding: 12px; font-family: monospace; font-size: 13px; margin-bottom: 10px; }
.add-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.add-form input { flex: 1; min-width: 140px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font: inherit; }
.restore-form { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 10; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: var(--card); border: 1px solid var(--field-border); border-radius: 20px; padding: 28px; width: min(360px, 90%); text-align: center; animation: pop-in .3s both; }
.modal-content input { width: 100%; padding: 12px; margin: 12px 0; border-radius: 12px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font: inherit; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; }

/* --- Страница "Система" --- */
.system-wrap { max-width: 900px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; justify-content: center; }
.tab-btn { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--field-border); background: var(--field); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; transition: all .2s; }
.tab-btn.active, .tab-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-content { display: none; text-align: left; background: rgba(20, 23, 30, .55); border: 1px solid var(--field-border); border-radius: 16px; padding: 20px; animation: pop-in .4s both; }
.tab-content.active { display: block; }
.tab-content h3 { margin: 0 0 12px; font-size: 16px; }
.service-item, .dns-item, .mac-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--field); margin-bottom: 8px; font-size: 14px; }
.service-item span:first-child, .dns-item span:first-child, .mac-item span:first-child { flex: 1; word-break: break-all; text-align: left; }
.service-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.service-status.active { background: rgba(53, 208, 165, .15); color: #35d0a5; }
.service-status.inactive { background: rgba(255, 84, 112, .15); color: var(--danger); }
.tab-content button { padding: 8px 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.tab-content textarea { width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--field-border); border-radius: 12px; padding: 12px; font-family: monospace; font-size: 13px; margin-bottom: 10px; }
.add-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.add-form input { flex: 1; min-width: 140px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font: inherit; }
.restore-form { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 10; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: var(--card); border: 1px solid var(--field-border); border-radius: 20px; padding: 28px; width: min(360px, 90%); text-align: center; animation: pop-in .3s both; }
.modal-content input { width: 100%; padding: 12px; margin: 12px 0; border-radius: 12px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font: inherit; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; }

/* --- Страница "Система" --- */
.system-wrap { max-width: 900px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; justify-content: center; }
.tab-btn { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--field-border); background: var(--field); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; transition: all .2s; }
.tab-btn.active, .tab-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-content { display: none; text-align: left; background: rgba(20, 23, 30, .55); border: 1px solid var(--field-border); border-radius: 16px; padding: 20px; animation: pop-in .4s both; }
.tab-content.active { display: block; }
.tab-content h3 { margin: 0 0 12px; font-size: 16px; }
.service-item, .dns-item, .mac-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--field); margin-bottom: 8px; font-size: 14px; }
.service-item span:first-child, .dns-item span:first-child, .mac-item span:first-child { flex: 1; word-break: break-all; text-align: left; }
.service-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.service-status.active { background: rgba(53, 208, 165, .15); color: #35d0a5; }
.service-status.inactive { background: rgba(255, 84, 112, .15); color: var(--danger); }
.tab-content button { padding: 8px 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.tab-content textarea { width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--field-border); border-radius: 12px; padding: 12px; font-family: monospace; font-size: 13px; margin-bottom: 10px; }
.add-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.add-form input { flex: 1; min-width: 140px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font: inherit; }
.restore-form { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 10; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: var(--card); border: 1px solid var(--field-border); border-radius: 20px; padding: 28px; width: min(360px, 90%); text-align: center; animation: pop-in .3s both; }
.modal-content input { width: 100%; padding: 12px; margin: 12px 0; border-radius: 12px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font: inherit; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; }

/* --- Страница "Система" --- */
.system-wrap { max-width: 940px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; justify-content: center; }
.tab-btn { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--field-border); background: var(--field); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; transition: all .2s; }
.tab-btn.active, .tab-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-content { display: none; text-align: left; background: rgba(20, 23, 30, .55); border: 1px solid var(--field-border); border-radius: 16px; padding: 20px; animation: pop-in .4s both; }
.tab-content.active { display: block; }
.tab-content h3 { margin: 0 0 12px; font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; }
.service-item, .dns-item, .mac-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--field); margin-bottom: 8px; font-size: 14px; }
.service-item span:first-child, .dns-item span:first-child, .mac-item span:first-child { flex: 1; word-break: break-all; text-align: left; }
.service-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.service-status.active { background: rgba(53, 208, 165, .15); color: #35d0a5; }
.service-status.inactive { background: rgba(255, 84, 112, .15); color: var(--danger); }
.tab-content button { padding: 8px 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.tab-content textarea { width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--field-border); border-radius: 12px; padding: 12px; font-family: monospace; font-size: 13px; margin-bottom: 10px; }
.add-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.add-form input { flex: 1; min-width: 140px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font: inherit; }
.restore-form { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 10; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: var(--card); border: 1px solid var(--field-border); border-radius: 20px; padding: 28px; width: min(360px, 90%); text-align: center; animation: pop-in .3s both; }
.modal-content input { width: 100%; padding: 12px; margin: 12px 0; border-radius: 12px; border: 1px solid var(--field-border); background: var(--field); color: var(--text); font: inherit; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; }

/* --- Красивый выбор файла --- */
.restore-form input[type="file"] {
    flex: 1;
    min-width: 220px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--field-border);
    background: var(--field);
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .2s;
}

.restore-form input[type="file"]:hover { border-color: var(--accent); }

.restore-form input[type="file"]::file-selector-button {
    border: 0;
    border-radius: 10px;
    padding: 8px 14px;
    margin-right: 12px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter .2s;
}

.restore-form input[type="file"]::file-selector-button:hover { filter: brightness(1.1); }


/* --- Облако --- */
.cloud-wrap { max-width: 900px; }
.dropzone { border: 2px dashed var(--field-border); border-radius: 16px; padding: 24px; text-align: center; color: var(--muted); transition: all .2s; margin: 20px 0; }
.dropzone.drag { border-color: var(--accent); background: rgba(47, 155, 255, .08); color: var(--text); }
.dropzone button { margin-top: 10px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.upload-status { margin-top: 10px; font-size: 13px; color: var(--accent); min-height: 18px; }
.cloud-table-wrap { max-height: 320px; overflow-y: auto; border: 1px solid var(--field-border); border-radius: 12px; }
.cloud-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.cloud-table th, .cloud-table td { padding: 10px 14px; border-bottom: 1px solid var(--field-border); }
.cloud-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; position: sticky; top: 0; background: #20242e; }
.cloud-table tr:last-child td { border-bottom: 0; }
.cloud-table .fname { word-break: break-all; }
.row-actions { white-space: nowrap; text-align: right; }
.btn-small { display: inline-block; padding: 6px 12px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font: inherit; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; margin-left: 6px; }
.btn-small.btn-danger { background: var(--danger); }

/* --- Публичные ссылки --- */
.shares-block { margin-top: 24px; text-align: left; }
.shares-block h3 { margin: 0 0 10px; font-size: 16px; }
.btn-small.btn-link { background: #35d0a5; }

/* --- Прогресс загрузки --- */
.progress-wrap { margin-top: 14px; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--field); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #35d0a5); border-radius: 999px; transition: width .15s ease; box-shadow: 0 0 10px rgba(47, 155, 255, .5); }
.progress-text { margin-top: 6px; font-size: 12px; color: var(--muted); word-break: break-all; }

/* --- Модальное окно --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    animation: fade-in .2s ease;
}

.modal.active {
    display: flex;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--field-border);
    border-radius: 20px;
    padding: 32px;
    width: min(400px, 90%);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    animation: modal-pop .3s cubic-bezier(.22, .61, .36, 1);
}

@keyframes modal-pop {
    from { opacity: 0; transform: scale(.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h3 {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 700;
}

.modal-content p {
    color: var(--muted);
    margin: 0 0 20px;
    font-size: 14px;
}

.modal-content input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--field-border);
    background: var(--field);
    color: var(--text);
    font: inherit;
    outline: none;
    margin-bottom: 24px;
    transition: border-color .2s, box-shadow .2s;
}

.modal-content input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 155, 255, .25);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-buttons button {
    flex: 1;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter .2s, transform .15s, box-shadow .2s;
}

.modal-buttons button:first-child {
    background: var(--danger);
    color: #fff;
}

.modal-buttons button:first-child:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(255, 84, 112, .35);
}

.modal-buttons button:last-child {
    background: var(--field);
    color: var(--text);
    border: 1px solid var(--field-border);
}

.modal-buttons button:last-child:hover {
    background: #3a3f4a;
}

.modal-buttons button:active {
    transform: translateY(1px);
}

/* === Кастомный скроллбар === */

/* Для Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(38, 42, 51, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(154, 163, 178, 0.4);
    border-radius: 10px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(47, 155, 255, 0.6);
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(154, 163, 178, 0.4) rgba(38, 42, 51, 0.3);
}

/* Специально для музыкального плеера и списков треков */
#tab-content::-webkit-scrollbar-track,
.cloud-table-wrap::-webkit-scrollbar-track {
    background: rgba(38, 42, 51, 0.5);
}

#tab-content::-webkit-scrollbar-thumb,
.cloud-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(47, 155, 255, 0.3);
}

#tab-content::-webkit-scrollbar-thumb:hover,
.cloud-table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(47, 155, 255, 0.6);
}

/* === Музыкальные вкладки (круглые SVG, не конфликтуют с системными .tab-btn) === */
.music-tab-btn {
    padding: 10px !important;
    cursor: pointer;
    background: transparent !important;
    color: #888 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    font: inherit !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-bottom: 3px solid transparent !important;
}

.music-tab-btn:hover {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-2px);
}

.music-tab-btn.active {
    color: #fff !important;
    border-color: #4CAF50 !important;
    border-bottom: 3px solid #4CAF50 !important;
    background: rgba(76, 175, 80, 0.1) !important;
}

.music-tab-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}