:root {
    --bg-main: #0a0a0a;
    --bg-card: #141414;
    --bg-nav: #111111;
    --border-color: #2a2a2a;
    --text-main: #f0f0f0;
    --text-muted: #888888;
    --accent: #4a9eff;
    --accent-hover: #3a8eef;
    --success: #34d399;
    --danger: #f87171;
    --font-family: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background-color: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
}

.logo-icon {
    color: var(--accent);
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: flex-end;
}

.nav-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn-active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.nav-btn-danger {
    color: var(--danger);
}

.nav-user-info {
    color: var(--text-main);
}

.nav-divider {
    height: 28px;
    border-left: 1px solid var(--border-color);
    margin: 0 2px;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: #fff;
}

/* Main Content */
main {
    flex: 1;
    padding: 40px 20px;
}

h1, h2 {
    margin-bottom: 20px;
    font-weight: 600;
}

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

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 22px;
}

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

.bot-title {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status.running {
    color: var(--success);
    background-color: rgba(52, 211, 153, 0.1);
}

.status.running::before {
    background-color: var(--success);
}

.status.stopped {
    color: var(--text-muted);
    background-color: rgba(136, 136, 136, 0.1);
}

.status.stopped::before {
    background-color: var(--text-muted);
}

.bot-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.bot-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s;
    min-height: 42px;
}

.btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-fill {
    background-color: var(--bg-card);
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background-color: rgba(248, 113, 113, 0.1);
}

.btn-success {
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.3);
}

.btn-success:hover {
    background-color: rgba(52, 211, 153, 0.1);
}

/* Pterodactyl-like UI Styles */
.bot-header {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
}

.bot-header-title {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.bot-header-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.bot-tabs {
    display: flex;
    background-color: rgba(0,0,0,0.2);
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-main);
}

.tab.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.console-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.console-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.status-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-item:last-child {
    border-bottom: none;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.running { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.status-indicator.stopped { background-color: var(--danger); }
.status-indicator.starting { background-color: #fbbf24; }

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-action {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s;
}

.btn-action.start { background-color: #3b82f6; }
.btn-action.start:hover { background-color: #2563eb; }
.btn-action.restart { background-color: #6366f1; }
.btn-action.restart:hover { background-color: #4f46e5; }
.btn-action.stop { background-color: #ef4444; }
.btn-action.stop:hover { background-color: #dc2626; }
.btn-action.delete { background-color: transparent; border: 1px solid #ef4444; color: #ef4444; }
.btn-action.delete:hover { background-color: #ef4444; color: #fff; }

.console-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.terminal-container {
    background-color: #050505;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 320px;
    overflow: hidden;
}

.terminal-header {
    background-color: #0b0b0b;
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a3a3a3;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.terminal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.terminal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--success);
    font-weight: 700;
}

#terminal-output {
    flex: 1;
    background-color: #050505;
    padding: 15px;
    margin: 0;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.graphs-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.graph-box {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    min-width: 0;
    height: 260px;
}

.graph-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.graph-box canvas {
    display: block;
    width: 100% !important;
    height: 190px !important;
}

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

.file-manager-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.path-breadcrumb {
    margin-bottom: 15px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: 'Consolas', 'Courier New', monospace;
}

.file-create-panel {
    margin-bottom: 15px;
    padding: 18px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.create-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
    gap: 15px;
    align-items: end;
}

.create-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-control {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    min-height: 46px;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

select.form-control {
    appearance: none;
    background-color: rgba(0,0,0,0.2);
}

@media (max-width: 960px) {
    .console-layout {
        flex-direction: column;
    }

    .console-sidebar {
        width: 100%;
    }

    .graphs-container {
        grid-template-columns: 1fr;
    }

    .create-grid {
        grid-template-columns: 1fr;
    }

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

    .editor-body {
        grid-template-columns: 52px minmax(0, 1fr);
    }
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    flex: 1;
}

.radio-btn input {
    display: none;
}

.radio-btn.active {
    border-color: var(--accent);
    background-color: rgba(74, 158, 255, 0.1);
}

/* Sections */
.section-title {
    font-size: 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
    margin-top: 30px;
}

.upload-box {
    border: 1px dashed var(--border-color);
    padding: 20px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drop-zone {
    margin: 16px 0;
    border: 2px dashed rgba(74, 158, 255, 0.45);
    border-radius: 10px;
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted);
    background: rgba(74, 158, 255, 0.04);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.drop-zone i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.drop-zone p {
    margin: 0 0 6px;
    color: var(--text-main);
    font-weight: 500;
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(74, 158, 255, 0.12);
    transform: scale(1.01);
}

.zip-auto-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: 8px;
}

.debug-panel {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    overflow: hidden;
}

.debug-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.debug-toolbar h3 {
    margin: 0;
    font-size: 1rem;
}

.debug-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.debug-log-output {
    margin: 0;
    padding: 16px;
    min-height: 360px;
    max-height: 65vh;
    overflow: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: #d4e4ff;
    background: #050505;
}

.file-list {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card);
}

.file-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.file-item:hover {
    background: rgba(255,255,255,0.03);
}

.file-item.directory {
    cursor: pointer;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-user-form {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(140px, 0.6fr) auto;
    gap: 16px;
    align-items: end;
}

.admin-user-field,
.admin-user-role {
    min-width: 0;
}

.admin-user-submit {
    min-height: 46px;
    justify-content: center;
}

.editor-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.editor-shell {
    background: #050505;
    width: min(1200px, 100%);
    height: min(90vh, 920px);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
}

.editor-toolbar {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    background: #0b0b0b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.editor-toolbar h3 {
    margin: 0;
    font-size: 1rem;
}

.editor-toolbar p {
    margin: 4px 0 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.editor-toolbar-actions {
    display: flex;
    gap: 10px;
}

.editor-body {
    flex: 1;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 0;
    background: #050505;
}

.editor-line-numbers {
    margin: 0;
    padding: 18px 12px 18px 18px;
    overflow: hidden;
    background: #0b0b0b;
    color: #888888;
    text-align: right;
    user-select: none;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    border-right: 1px solid var(--border-color);
}

.editor-textarea {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    outline: none;
    background: #050505;
    color: #e2e8f0;
    padding: 18px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre;
    overflow: auto;
}

.editor-statusbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    border-top: 1px solid var(--border-color);
    background: #0b0b0b;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Toast */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 0;
    padding: 14px 20px;
    min-width: 280px;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: #f0f0f0;
    font-size: 0.9rem;
    pointer-events: all;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.hide {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close { cursor: pointer; opacity: 0.5; transition: opacity 0.2s; font-size: 0.8rem; }
.toast-close:hover { opacity: 1; }
.toast.success { border-left: 3px solid #34d399; }
.toast.success .toast-icon { color: #34d399; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.error .toast-icon { color: #ef4444; }
.toast.info { border-left: 3px solid #4a9eff; }
.toast.info .toast-icon { color: #4a9eff; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(60px); }
}

/* Confirm Dialog */
#confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

#confirm-overlay.hide { animation: fadeOut 0.2s ease forwards; }

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

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

#confirm-box {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 0;
    padding: 28px 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
    animation: boxIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    text-align: center;
}

@keyframes boxIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

#confirm-box .confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 0;
    font-size: 1.8rem;
    margin: 0 auto 20px auto;
}

#confirm-box .confirm-icon.primary {
    background: rgba(74, 158, 255, 0.12);
    color: #4a9eff;
    border: 1px solid rgba(74, 158, 255, 0.3);
}

#confirm-box .confirm-icon.danger {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

#confirm-box .confirm-icon.warning {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

#confirm-box .confirm-icon.info {
    background: rgba(74, 158, 255, 0.12);
    color: #4a9eff;
    border: 1px solid rgba(74, 158, 255, 0.3);
}

#confirm-box .confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 8px;
}

#confirm-box .confirm-msg {
    font-size: 0.88rem;
    color: #888888;
    margin-bottom: 24px;
    line-height: 1.6;
}

#confirm-box .confirm-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

#confirm-box .confirm-btns button {
    padding: 10px 28px;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #2a2a2a;
    transition: all 0.2s;
}

#confirm-box .btn-cancel {
    background: transparent;
    color: #f0f0f0;
}

#confirm-box .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

#confirm-box .btn-ok-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

#confirm-box .btn-ok-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

#confirm-box .btn-ok-primary {
    background: #4a9eff;
    border-color: #4a9eff;
    color: #fff;
}

#confirm-box .btn-ok-primary:hover {
    background: #3a8eef;
    border-color: #3a8eef;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Utils */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    main {
        padding: 32px 16px;
    }

    .nav-content {
        align-items: flex-start;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-btn {
        padding: 8px 14px;
        font-size: 0.88rem;
    }

    .admin-user-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-role,
    .admin-user-submit {
        grid-column: span 1;
    }
}

@media (max-width: 960px) {
    .page-header,
    .card-header,
    .file-item,
    .upload-box {
        flex-direction: column;
        align-items: stretch;
    }

    .bot-tabs {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tab {
        flex: 1 0 auto;
        text-align: center;
        padding: 12px 18px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    .navbar {
        padding: 12px 0;
    }

    .nav-content {
        flex-direction: column;
        align-items: stretch;
    }

    .logo {
        justify-content: center;
    }

    .nav-links {
        width: 100%;
        justify-content: stretch;
    }

    .nav-btn,
    .nav-user-info {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
        min-width: 0;
    }

    .nav-divider {
        display: none;
    }

    .page-header {
        gap: 12px;
        margin-bottom: 22px;
    }

    .card,
    .settings-card,
    .status-box,
    .graph-box,
    .file-create-panel {
        padding: 18px;
    }

    .terminal-header {
        align-items: flex-start;
    }

    .terminal-meta {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .admin-user-form {
        grid-template-columns: 1fr;
    }

    .admin-user-submit,
    .create-actions .btn,
    .file-manager-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .file-name {
        min-width: 0;
        word-break: break-word;
    }

    .file-size {
        text-align: left;
    }

    .editor-modal {
        padding: 12px;
    }

    .editor-shell {
        height: min(92vh, 920px);
        border-radius: 12px;
    }
}

@media (max-width: 576px) {
    main {
        padding: 24px 10px;
    }

    h1, h2 {
        margin-bottom: 14px;
    }

    .logo {
        font-size: 1.05rem;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-btn,
    .nav-user-info {
        flex: 1 1 100%;
        width: 100%;
        font-size: 0.84rem;
        padding: 9px 12px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
    }

    .card,
    .settings-card,
    .status-box,
    .graph-box,
    .file-create-panel {
        padding: 14px;
    }

    .bot-header-title {
        padding: 16px;
    }

    .bot-header-title h1 {
        font-size: 1.2rem;
        overflow-wrap: anywhere;
    }

    .tab {
        padding: 11px 14px;
        font-size: 0.88rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
    }

    .terminal-container {
        height: 300px;
    }

    .terminal-header {
        padding: 10px 12px;
        font-size: 0.8rem;
        flex-direction: column;
    }

    #terminal-output {
        padding: 12px;
        font-size: 0.8rem;
    }

    .path-breadcrumb {
        font-size: 0.82rem;
        overflow-x: auto;
        white-space: nowrap;
    }

    .editor-toolbar {
        padding: 14px;
    }

    .editor-toolbar h3 {
        font-size: 0.92rem;
        overflow-wrap: anywhere;
    }

    .editor-body {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .editor-line-numbers,
    .editor-textarea {
        font-size: 12px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .editor-textarea {
        padding-left: 12px;
        padding-right: 12px;
    }

    .editor-statusbar {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 0 10px;
    }

    .logo {
        font-size: 0.98rem;
    }

    .nav-btn,
    .nav-user-info,
    .btn,
    .btn-action {
        font-size: 0.8rem;
    }

    .tab {
        font-size: 0.82rem;
    }
}
