:root {
    --bg: #070d18;
    --surface: rgba(18, 29, 47, 0.92);
    --surface-strong: rgba(16, 26, 43, 0.98);
    --ink: #eef4ff;
    --muted: #bfd2ef;
    --line: rgba(124, 155, 199, 0.18);
    --accent: #29f08a;
    --accent-soft: rgba(41, 240, 138, 0.14);
    --success: #42f58c;
    --danger: #ffacac;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    --radius-lg: 8px;
    --radius-md: 8px;
    --radius-sm: 8px;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #08111f 0%, #07101d 48%, #050b14 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(41, 240, 138, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(41, 240, 138, 0.06) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 80%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.landing-shell,
.dashboard-main {
    position: relative;
    z-index: 1;
}

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px 18px;
}

.login-panel {
    display: grid;
    width: min(100%, 460px);
    gap: 42px;
}

.login-brand {
    display: grid;
    justify-items: center;
    text-align: center;
}

.login-logo {
    position: relative;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 10px;
    color: #eef4ff;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.login-logo::before {
    content: "";
    position: absolute;
    width: 26px;
    height: 7px;
    top: 8px;
    left: 7px;
    border-radius: 999px;
    background: var(--accent);
}

.login-logo::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    top: 7px;
    right: 7px;
    border-radius: 50%;
    background: #eef4ff;
}

.login-brand h1 {
    margin: 0;
    color: #f4f7fb;
    font-size: 3.45rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.login-brand p {
    margin: 22px 0 0;
    color: #d6e2f5;
    line-height: 1.45;
}

.login-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
}

.login-card h2 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.2;
}

.login-card form {
    gap: 14px;
}

.login-card label {
    margin-bottom: -4px;
    color: #cfe0f7;
    font-size: 0.88rem;
}

.login-card input {
    min-height: 40px;
    padding: 10px 13px;
    border-color: rgba(124, 155, 199, 0.18);
    background: rgba(8, 16, 30, 0.78);
    color: #eef4ff;
}

.login-card .button {
    min-height: 45px;
    margin-top: 2px;
    border-radius: var(--radius-lg);
    background: #2bbc79;
    color: #ffffff;
}

.landing-shell {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.hero,
.auth-grid,
.package-grid,
.project-grid,
.overview-grid,
.package-detail {
    display: grid;
    gap: 18px;
}

.hero {
    grid-template-columns: 1.3fr 0.9fr;
    align-items: stretch;
    padding: 56px 0 24px;
}

.hero-copy h1,
.section-heading h2 {
    margin: 0;
    line-height: 1.08;
    letter-spacing: -0.025em;
    font-size: clamp(2.35rem, 4.6vw, 4.5rem);
    font-weight: 700;
}

.hero-text,
.package-card p,
.project-card p,
.section-heading p,
.overview-card span,
.sidebar-account span {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.card-label {
    margin: 0 0 12px;
    font-weight: 700;
    line-height: 1.35;
}

.hero-card,
.auth-card,
.package-card,
.project-card,
.overview-card,
.package-detail,
.dashboard-sidebar,
.flash-message {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.hero-card,
.auth-card,
.package-card,
.project-card,
.overview-card,
.package-detail,
.dashboard-sidebar {
    padding: 24px;
}

.hero-card ul,
.detail-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.auth-section {
    padding: 18px 0 32px;
}

.auth-grid {
    grid-template-columns: repeat(2, 1fr);
}

form {
    display: grid;
    gap: 12px;
}

label {
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.35;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(5, 13, 25, 0.94);
    color: var(--ink);
}

p,
li,
span,
strong {
    word-break: normal;
}

.hero-copy,
.section-heading,
.project-card,
.package-card,
.auth-card,
.overview-card {
    overflow-wrap: anywhere;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(41, 240, 138, 0.18);
    border-color: rgba(41, 240, 138, 0.44);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    transition: transform 180ms ease, background 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: rgba(18, 91, 62, 0.96);
    border-color: rgba(41, 240, 138, 0.32);
    color: #eafff3;
}

.button-secondary {
    background: rgba(9, 22, 42, 0.96);
    border-color: var(--line);
    color: var(--ink);
}

.button-danger {
    background: rgba(83, 28, 35, 0.96);
    border-color: rgba(255, 172, 172, 0.32);
    color: #ffd7d7;
}

.button-small {
    min-height: 38px;
    padding: 0 14px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
}

.button-upload {
    min-height: 46px;
    border-radius: var(--radius-lg);
    background: #2bbc79;
    border-color: rgba(41, 240, 138, 0.35);
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(41, 240, 138, 0.12);
}

.button-full {
    width: 100%;
}

.flash-message {
    margin: 12px 0 18px;
    padding: 14px 18px;
}

.flash-success {
    color: #9af2c0;
    background: rgba(10, 49, 34, 0.58);
}

.flash-error {
    color: var(--danger);
    background: rgba(56, 18, 22, 0.58);
}

.dashboard-body {
    overflow-x: hidden;
}

.dashboard-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    width: min(calc(100% - 32px), 1400px);
    margin: 0 auto;
    padding: 18px 0 36px;
}

.dashboard-sidebar {
    position: sticky;
    top: 18px;
    align-self: start;
    background: var(--surface-strong);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    background: rgba(27, 69, 63, 0.96);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
    flex-shrink: 0;
    padding: 0;
}

.sidebar-brand-text span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.dashboard-menu {
    display: grid;
    gap: 10px;
}

.dashboard-menu a {
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    color: #d9e7ff;
    background: rgba(10, 20, 37, 0.7);
    line-height: 1.35;
    border: 1px solid transparent;
}

.dashboard-menu a:hover {
    color: var(--ink);
    background: rgba(41, 240, 138, 0.12);
}

.dashboard-menu a.active {
    color: var(--accent);
    border-color: rgba(41, 240, 138, 0.16);
    box-shadow: none;
    background: rgba(27, 69, 63, 0.78);
}

.sidebar-account {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.dashboard-main {
    padding: 10px 0 0;
}

.dashboard-hero {
    padding: 14px 0 30px;
}

.overview-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 22px;
}

.overview-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 2rem;
    line-height: 1.1;
}

.dashboard-section {
    padding: 14px 0 30px;
}

.section-heading {
    max-width: 860px;
    margin-bottom: 20px;
}

.package-grid,
.project-grid {
    grid-template-columns: repeat(3, 1fr);
}

.package-card.selected {
    border-color: rgba(41, 240, 138, 0.46);
    box-shadow: 0 0 0 1px rgba(41, 240, 138, 0.12), var(--shadow);
}

.category-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(10, 20, 37, 0.7);
    color: #d9e7ff;
    font-weight: 700;
}

.category-pill.active {
    border-color: rgba(41, 240, 138, 0.46);
    box-shadow: none;
    background: rgba(27, 69, 63, 0.78);
}

.user-list-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.user-list-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: #d9e7ff;
    box-shadow: var(--shadow);
}

.user-list-card span {
    color: var(--muted);
}

.user-list-card.active {
    border-color: rgba(41, 240, 138, 0.46);
    box-shadow: 0 0 0 1px rgba(41, 240, 138, 0.12), var(--shadow);
}

.package-card h3,
.project-card h3 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.package-detail {
    grid-template-columns: 1.1fr 0.9fr;
    margin-top: 18px;
}

.project-meta,
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-meta {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.project-tags {
    margin-top: 14px;
}

.project-tags span,
.project-meta span {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #d3e4ff;
    font-size: 0.86rem;
    line-height: 1.25;
}

.empty-state,
.bot-card,
.bot-detail {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.empty-state {
    display: grid;
    justify-items: start;
    gap: 12px;
    max-width: 620px;
    padding: 24px;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.empty-state p {
    color: var(--muted);
    line-height: 1.7;
}

.bot-hosting-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
}

.bot-list {
    display: grid;
    align-content: start;
    gap: 12px;
}

.bot-card {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.bot-card.selected {
    border-color: rgba(41, 240, 138, 0.46);
    box-shadow: 0 0 0 1px rgba(41, 240, 138, 0.12), var(--shadow);
}

.bot-card-top,
.bot-detail-header,
.bot-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bot-card > span,
.bot-detail-header span,
.bot-config-grid span {
    color: var(--muted);
    line-height: 1.45;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.status-pill.online {
    background: rgba(41, 240, 138, 0.14);
    color: var(--accent);
}

.status-pill.offline {
    background: rgba(255, 172, 172, 0.12);
    color: #ffb8b8;
}

.bot-metrics,
.bot-stat-grid,
.bot-config-grid {
    display: grid;
    gap: 10px;
}

.bot-metrics {
    grid-template-columns: repeat(2, 1fr);
}

.bot-metrics span,
.bot-stat-grid div,
.bot-config-grid div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(8, 16, 30, 0.5);
}

.bot-detail {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.bot-detail-header h3 {
    margin: 0 0 6px;
    font-size: 1.55rem;
}

.bot-stat-grid {
    grid-template-columns: repeat(3, 1fr);
}

.bot-stat-grid strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.bot-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.bot-actions form {
    display: block;
}

.bot-actions .button {
    min-height: 42px;
    border-radius: var(--radius-lg);
}

.bot-config-grid {
    grid-template-columns: repeat(3, 1fr);
}

.bot-config-grid code {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere;
    color: #dfffea;
}

.file-manager {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(8, 16, 30, 0.5);
}

.file-manager-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
}

.file-manager-header h3 {
    margin: 0;
}

.upload-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: min(100%, 460px);
}

.file-picker {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    min-width: 0;
    padding: 0 14px;
    border: 1px dashed rgba(41, 240, 138, 0.38);
    border-radius: var(--radius-lg);
    background: rgba(8, 16, 30, 0.78);
    color: #dfffea;
    cursor: pointer;
    font-weight: 700;
}

.file-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-picker span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-empty {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.file-list {
    display: grid;
    gap: 8px;
}

.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(3, 8, 15, 0.34);
}

.file-info {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.file-info strong,
.file-info span {
    overflow-wrap: anywhere;
}

.file-row span,
.file-info span {
    color: var(--muted);
    font-size: 0.88rem;
}

.file-remove-form {
    display: block;
    flex-shrink: 0;
}

.console-panel {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: rgba(3, 8, 15, 0.92);
    color: #d8e5f7;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.55;
}

.console-line span {
    color: var(--accent);
}

.console-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.console-form .button {
    min-height: 48px;
    border-radius: var(--radius-lg);
}

.hash-code {
    display: block;
    overflow-wrap: anywhere;
    padding: 12px;
    border-radius: 12px;
    background: rgba(4, 11, 20, 0.92);
    color: #a9f7cc;
    font-size: 0.82rem;
    line-height: 1.5;
}

.hero-card {
    padding: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(18, 29, 47, 0.98), rgba(16, 26, 43, 0.98));
}

.terminal-window {
    display: grid;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px 10px;
    color: #bfc7d8;
    font-family: Consolas, "Courier New", monospace;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot-red {
    background: #f05a55;
}

.terminal-dot-yellow {
    background: #f4be30;
}

.terminal-dot-green {
    background: #2ccb4d;
}

.terminal-title {
    font-size: 0.95rem;
}

.terminal-body {
    padding: 6px 18px 18px;
    color: #edf2fa;
    font-family: Consolas, "Courier New", monospace;
}

.terminal-body p {
    margin: 0 0 8px;
    line-height: 1.6;
}

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

.terminal-muted {
    color: #c8cfdb;
}

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

.terminal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(16, 39, 37, 0.96);
}

.terminal-status-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 700;
}

.terminal-status-name::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(41, 240, 138, 0.5);
}

.terminal-status-pill {
    padding: 8px 12px;
    border: 1px solid rgba(134, 152, 182, 0.22);
    border-radius: 10px;
    background: rgba(84, 102, 120, 0.32);
    color: #cfd8e4;
    font-size: 0.92rem;
}

.reveal {
    opacity: 1;
    transform: none;
}

@media (max-width: 1100px) {
    .package-grid,
    .project-grid,
    .user-list-grid,
    .overview-grid,
    .package-detail,
    .bot-hosting-layout,
    .bot-stat-grid,
    .bot-config-grid,
    .upload-form,
    .console-form {
        grid-template-columns: 1fr;
    }

    .file-manager-header,
    .file-row {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 900px) {
    .hero,
    .auth-grid,
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .landing-shell,
    .dashboard-layout {
        width: min(calc(100% - 22px), var(--max-width));
    }

    .hero-card,
    .auth-card,
    .package-card,
    .project-card,
    .overview-card,
    .package-detail,
    .dashboard-sidebar,
    .flash-message {
        border-radius: var(--radius-lg);
    }
}
