/* =============================================
   Page Layout with Sidebar
   ============================================= */

.page-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* =============================================
   Sidebar
   ============================================= */

.sidebar {
    width: 200px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.25s var(--ease-out-expo);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.logo-mark {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--text-primary);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.logo-text {
    font-weight: 600;
    font-size: 13px;
}

.nav {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
}

.nav-section {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 16px 10px 6px;
}

.nav-section:first-child {
    padding-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1px;
    transition: var(--transition);
    font-size: 13px;
    position: relative;
}

.nav-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    flex-shrink: 0;
    transition: var(--transition);
}

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

.nav-item:hover svg {
    opacity: 0.8;
}

.nav-item.active {
    background: rgba(34, 197, 94, 0.08);
    color: var(--text-primary);
    font-weight: 500;
    border-left: 2px solid var(--accent-green);
    padding-left: 8px;
}

.nav-item.active svg {
    opacity: 1;
    color: var(--accent-green);
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-blue);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.4;
}

.nav-badge.hidden {
    display: none;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer .server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

/* =============================================
   Page Content
   ============================================= */

.page-content {
    flex: 1;
    margin-left: 200px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

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

.header-actions {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

/* =============================================
   Buttons
   ============================================= */

.btn {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--text-primary);
    color: #000;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color-2);
}

.btn-danger {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-red);
}

.btn-warning {
    background: transparent;
    color: var(--accent-yellow);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.btn-warning:hover {
    background: rgba(234, 179, 8, 0.1);
    border-color: var(--accent-yellow);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* =============================================
   Stat Cards (shared)
   ============================================= */

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card:hover {
    border-color: var(--border-color-2);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-body {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* =============================================
   Loading & Empty States (shared)
   ============================================= */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    gap: 12px;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(34, 197, 94, 0.2);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    opacity: 0.3;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 320px;
}

.empty-state .hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* =============================================
   Toast Notifications (shared)
   ============================================= */

.toast-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.35s var(--ease-out-expo);
    cursor: pointer;
}

.toast-notification.toast-removing {
    animation: toastOut 0.3s var(--ease-out-expo) forwards;
}

.toast-notification:hover {
    filter: brightness(1.05);
}

.toast-notification .toast-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.toast-notification .toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0 0 8px;
    transition: var(--transition-fast);
}

.toast-notification .toast-close:hover {
    opacity: 1;
}

.toast-success {
    background: linear-gradient(135deg, #166534, #15803d);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast-error {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.toast-warning {
    background: linear-gradient(135deg, #78350f, #92400e);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.toast-info {
    background: linear-gradient(135deg, #1e3a5f, #1e40af);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

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

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

/* =============================================
   Modal (shared)
   ============================================= */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    animation: modalIn 0.3s var(--ease-out-expo);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* =============================================
   Lists (shared)
   ============================================= */

.list-divider,
.log-entry + .log-entry,
.player-item + .player-item,
.file-row + .file-row,
.perm-row + .perm-row {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* =============================================
   Tables (shared)
   ============================================= */

.table-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

table thead th {
    background: var(--bg-card);
    padding: 8px 16px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table tbody td {
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr {
    transition: var(--transition-fast);
}

table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badge system */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge.green { background: rgba(34, 197, 94, 0.15); color: var(--accent-green); }
.badge.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.badge.orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.badge.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge.yellow { background: rgba(234, 179, 8, 0.15); color: var(--accent-yellow); }
.badge.purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.badge.gray { background: rgba(136, 136, 136, 0.15); color: var(--text-secondary); }

/* =============================================
   Form Inputs (shared)
   ============================================= */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-color-2);
    box-shadow: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* =============================================
   Console
   ============================================= */

.console-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d0d0d;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.console-output {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    font-family: 'Geist Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    min-height: 400px;
    max-height: calc(100vh - 300px);
}

.log-line {
    padding: 4px 12px;
    margin: 0;
    word-break: break-word;
    display: flex;
    align-items: baseline;
    gap: 0;
    color: #ccc;
    padding-left: 12px;
}

/* Hanging indent for wrapped lines */
.log-line .mc-msg {
    flex: 1;
    min-width: 0;
}

/* Timestamp */
.mc-ts {
    color: #666;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Source tags */
.mc-src {
    margin-right: 8px;
    flex-shrink: 0;
    font-weight: 600;
}

.mc-src.src-server { color: #5b9cf5; }
.mc-src.src-rcon   { color: #e89840; }
.mc-src.src-auth   { color: #5b9cf5; }
.mc-src.src-warn   { color: var(--accent-orange); }
.mc-src.src-error  { color: var(--accent-red); }

/* Message content colors */
.mc-msg.msg-join   { color: #22c55e; }
.mc-msg.msg-join strong { font-weight: 700; }

.mc-msg.msg-leave  { color: #a855f7; }
.mc-msg.msg-leave strong { font-weight: 700; }

.mc-msg.msg-disconnect { color: #eab308; }
.mc-msg.msg-error  { color: var(--accent-red); }
.mc-msg.msg-warn   { color: var(--accent-orange); }
.mc-msg.msg-rcon   { color: #e89840; }
.mc-msg.msg-chat   { color: #64d8cb; }

/* Command (user input) */
.log-line.command {
    color: var(--accent-blue);
    font-weight: 500;
}

/* Success (connection messages) */
.log-line.success {
    color: var(--accent-green);
}

/* Error lines without MC format (stack traces etc.) */
.log-line.error {
    color: var(--accent-red);
}

/* Warn lines without MC format */
.log-line.warn {
    color: var(--accent-orange);
}

.log-line.historical {
    opacity: 0.7;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.connection-status .status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.connection-status .status-dot.offline {
    background: var(--accent-red);
}

.connection-status .status-dot.connecting {
    background: var(--accent-orange);
    animation: pulse 1s infinite;
}

.connection-status .status-dot.error {
    background: var(--accent-red);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Console Input */
.console-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    gap: 12px;
}

.input-prefix {
    color: var(--accent-green);
    font-family: monospace;
    font-weight: bold;
}

.input-container {
    flex: 1;
    position: relative;
}

.console-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 16px;
    color: var(--text-primary);
    font-family: 'Geist Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
}

.console-input:focus {
    outline: none;
    border-color: var(--border-color-2);
}

.console-input::placeholder {
    color: var(--text-muted);
}

/* Format Toolbar */
.format-toolbar {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
    padding: 8px 10px;
    gap: 10px;
    align-items: center;
    z-index: 101;
    flex-wrap: wrap;
}

.format-toolbar.active {
    display: flex;
}

.format-colors {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.15s;
    padding: 0;
}

.color-swatch:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.format-styles {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.style-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    padding: 0;
}

.style-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-color-2);
}

/* Command Suggestions Dropdown */
.command-suggestions {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.command-suggestions.active {
    display: block;
}

.suggestion-category {
    padding: 8px 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

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

.suggestion-item:hover,
.suggestion-item.selected {
    background: var(--bg-card-hover);
}

.suggestion-item .cmd {
    font-family: 'Geist Mono', 'Monaco', 'Consolas', monospace;
    color: var(--accent-green);
    font-size: 0.8125rem;
}

.suggestion-item .desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 12px;
    text-align: right;
}

.btn-send {
    background: var(--text-primary);
    color: #000;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 500;
}

.btn-send:hover {
    opacity: 0.9;
}

/* =============================================
   Log Filters
   ============================================= */

.console-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.5;
}

.filter-btn.active {
    opacity: 1;
    color: var(--text-primary);
}

.filter-btn[data-filter="all"].active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.filter-btn[data-filter="info"].active {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.filter-btn[data-filter="chat"].active {
    background: rgba(100, 216, 203, 0.2);
    border-color: #64d8cb;
    color: #64d8cb;
}

.filter-btn[data-filter="player"].active {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.filter-btn[data-filter="warn"].active {
    background: rgba(255, 152, 0, 0.2);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.filter-btn[data-filter="error"].active {
    background: rgba(244, 67, 54, 0.2);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Hidden log lines when filtered */
.log-line.filtered {
    display: none;
}

/* =============================================
   Quick Commands
   ============================================= */

.quick-commands {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.quick-cmd {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.quick-cmd:hover {
    background: var(--bg-card-hover);
    color: var(--accent-green);
    border-color: var(--accent-green);
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .logo-text,
    .nav-item span,
    .nav-section,
    .nav-badge,
    .sidebar-footer .server-status span:last-child {
        display: none;
    }

    .logo {
        justify-content: center;
        padding: 16px 8px;
    }

    .nav-item {
        justify-content: center;
        padding: 10px;
        min-height: 44px;
    }

    .nav-item svg {
        width: 18px;
        height: 18px;
    }

    .page-content {
        margin-left: 60px;
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    /* Buttons: 44px min touch target on mobile */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
    }

    /* Tables: horizontal scroll on mobile */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
        min-width: 500px;
    }

    /* Modals: near full-width on mobile */
    .modal-content {
        max-width: calc(100vw - 32px);
        margin: 16px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }

    /* Console input: usable on mobile */
    .console-input-wrapper {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .console-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .btn-send {
        min-height: 44px;
        padding: 10px 16px;
    }

    .console-output {
        min-height: 250px;
        max-height: calc(100vh - 350px);
    }

    /* Quick commands: wrap nicely */
    .quick-commands {
        gap: 6px;
    }

    .quick-cmd {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    /* Console filters */
    .console-filters {
        gap: 6px;
    }

    .filter-btn {
        min-height: 36px;
    }

    /* Form inputs: prevent iOS zoom */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }
}
