/**
 * Destinée Servers — Theme CSS (Dark Modern)
 * Inspiré de TCAdmin / Architect
 */

/* ═══════════════════════════════════════════
   VARIABLES & RESET
   ═══════════════════════════════════════════ */
:root {
    --bg-dark:        #0f1117;
    --bg-card:        #1a1d27;
    --bg-sidebar:     #12141c;
    --bg-header:      #161822;
    --bg-input:       #1e2130;
    --bg-hover:       #252838;
    --border-color:   #2a2d3a;
    --border-light:   #363a4a;

    --text-primary:   #e4e6eb;
    --text-secondary: #9ca3af;
    --text-muted:     #6b7280;

    --primary:        #3b82f6;
    --primary-hover:  #2563eb;
    --primary-light:  rgba(59, 130, 246, 0.15);
    --success:        #10b981;
    --success-light:  rgba(16, 185, 129, 0.15);
    --danger:         #ef4444;
    --danger-light:   rgba(239, 68, 68, 0.15);
    --warning:        #f59e0b;
    --warning-light:  rgba(245, 158, 11, 0.15);
    --info:           #6366f1;
    --info-light:     rgba(99, 102, 241, 0.15);

    --sidebar-width:  260px;
    --header-height:  60px;
    --radius:         8px;
    --radius-sm:      6px;
    --shadow:         0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg:      0 10px 25px rgba(0,0,0,0.4);
    --transition:     all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; }
code { background: var(--bg-input); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: var(--warning); }

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.content-area {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

body.sidebar-collapsed .main-content {
    margin-left: 70px;
}

body.sidebar-collapsed .sidebar {
    width: 70px;
}

body.sidebar-collapsed .sidebar .sidebar-brand span,
body.sidebar-collapsed .sidebar .nav-section-title,
body.sidebar-collapsed .sidebar-nav a span,
body.sidebar-collapsed .sidebar-user span {
    display: none;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.3s ease;
    overflow-x: hidden;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    white-space: nowrap;
}

.sidebar-brand i { font-size: 1.4rem; }

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-nav ul { list-style: none; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-nav a i { width: 20px; text-align: center; font-size: 1rem; }

.nav-section { margin-top: 8px; }

.nav-section-title {
    display: block;
    padding: 8px 20px 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.sidebar-user i { font-size: 1.3rem; }

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
.top-header {
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Dropdown */
.dropdown { position: relative; }

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
    font-size: inherit;
}

.dropdown-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 200;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.main-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-header);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.table-responsive { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-sidebar);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; color: #000; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--text-muted); }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-group { display: flex; gap: 6px; align-items: center; }

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control-sm { padding: 6px 10px; font-size: 0.85rem; }

select.form-control { appearance: auto; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-error {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
}

.form-inline {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

/* ═══════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════ */
.badge {
    display: inline-flex;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info);    }
.badge-muted   { background: rgba(107,114,128,0.15); color: var(--text-muted); }

/* ═══════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════ */
.alerts-container { margin-bottom: 20px; }

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid;
    animation: slideIn 0.3s ease;
}

.alert-success { background: var(--success-light); border-color: rgba(16,185,129,0.3); color: var(--success); }
.alert-error   { background: var(--danger-light);  border-color: rgba(239,68,68,0.3);  color: var(--danger);  }
.alert-warning { background: var(--warning-light); border-color: rgba(245,158,11,0.3); color: var(--warning); }
.alert-info    { background: var(--primary-light); border-color: rgba(59,130,246,0.3); color: var(--primary); }

.alert-icon { font-size: 1.1rem; }
.alert-message { flex: 1; font-size: 0.9rem; }

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px;
}
.alert-close:hover { opacity: 1; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   STATS (Dashboard)
   ═══════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-icon.bg-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.bg-success { background: var(--success-light); color: var(--success); }
.stat-icon.bg-danger  { background: var(--danger-light);  color: var(--danger);  }
.stat-icon.bg-info    { background: var(--info-light);    color: var(--info);    }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ═══════════════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════════════ */
.progress-item { margin-bottom: 16px; }
.progress-item:last-child { margin-bottom: 0; }

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.progress-bar.bg-primary { background: var(--primary); }
.progress-bar.bg-success { background: var(--success); }
.progress-bar.bg-warning { background: var(--warning); }

/* ═══════════════════════════════════════════
   SERVER CARDS (Dashboard)
   ═══════════════════════════════════════════ */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.server-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    transition: var(--transition);
}

.server-card:hover { border-color: var(--primary); }

.server-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.server-card-header h4 { font-size: 0.95rem; font-weight: 600; }

.server-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-running, .server-status.status-running { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-stopped, .server-status.status-stopped { background: var(--danger); }
.status-starting, .server-status.status-starting { background: var(--warning); animation: pulse 1.5s infinite; }
.status-stopping, .server-status.status-stopping { background: var(--warning); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.server-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.server-detail i { width: 16px; text-align: center; }

.server-card-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* ═══════════════════════════════════════════
   SERVER TABS
   ═══════════════════════════════════════════ */
.server-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 4px;
    margin-top: 16px;
}

.tab {
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.tab:hover { background: var(--bg-hover); color: var(--text-primary); }

.tab.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* ═══════════════════════════════════════════
   ACTIVITY LIST
   ═══════════════════════════════════════════ */
.activity-list { max-height: 300px; overflow-y: auto; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon { padding-top: 3px; font-size: 0.6rem; }

.activity-info { flex: 1; }

.activity-text { font-size: 0.85rem; display: block; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ═══════════════════════════════════════════
   AUTH PAGE
   ═══════════════════════════════════════════ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 0%, rgba(59,130,246,0.08) 0%, var(--bg-dark) 60%);
}

.auth-wrapper { width: 100%; max-width: 420px; padding: 20px; }

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-form .form-group { margin-bottom: 20px; }

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 8px 0;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: #6c9bff;
    text-decoration: underline;
}

/* Remember me checkbox */
.remember-group {
    margin-bottom: 24px;
    margin-top: -4px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-label span {
    line-height: 1;
}

.auth-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Alert links (inside flash messages) */
.alert a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.alert a:hover {
    color: #6c9bff;
}

/* ═══════════════════════════════════════════
   DETAIL TABLE
   ═══════════════════════════════════════════ */
.detail-table { width: 100%; }

.detail-table tr { border-bottom: 1px solid var(--border-color); }
.detail-table tr:last-child { border-bottom: none; }

.detail-table th {
    padding: 10px 0;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    width: 40%;
    text-align: left;
}

.detail-table td { padding: 10px 0; }

/* ═══════════════════════════════════════════
   MOD LIST (compact)
   ═══════════════════════════════════════════ */
.mod-list-compact {
    list-style: none;
}

.mod-list-compact li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.mod-list-compact li:last-child { border-bottom: none; }

.mod-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.mod-status.active { background: var(--success); }
.mod-status.inactive { background: var(--text-muted); }

/* ═══════════════════════════════════════════
   FILE MANAGER
   ═══════════════════════════════════════════ */
.breadcrumb-path {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb-path a { color: var(--primary); }
.breadcrumb-path .separator { color: var(--text-muted); }

.file-table .file-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.file-table .file-link:hover { color: var(--primary); }

.file-editor {
    width: 100%;
    min-height: 500px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: none;
    padding: 16px;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    tab-size: 4;
}

.file-editor:focus { outline: none; }

/* ═══════════════════════════════════════════
   LOG VIEWER
   ═══════════════════════════════════════════ */
.log-file-list {
    list-style: none;
}

.log-file-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.log-file-list li a:hover { background: var(--bg-hover); color: var(--text-primary); }
.log-file-list li a.active { background: var(--primary-light); color: var(--primary); }

.log-file-name { flex: 1; font-size: 0.85rem; }
.log-file-size { font-size: 0.75rem; color: var(--text-muted); }

.log-viewer {
    max-height: 600px;
    overflow: auto;
    background: var(--bg-dark);
}

.log-viewer pre {
    padding: 16px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   PRESET LIST
   ═══════════════════════════════════════════ */
.preset-list { display: flex; flex-wrap: wrap; gap: 8px; }

.preset-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.preset-item.active { border-color: var(--success); }

/* ═══════════════════════════════════════════
   PERMISSION GROUPS
   ═══════════════════════════════════════════ */
.permission-group {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.permission-module {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════
   CODE BLOCK (copy)
   ═══════════════════════════════════════════ */
.code-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.code-block code {
    flex: 1;
    background: none;
    padding: 0;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--success);
}

/* ═══════════════════════════════════════════
   DANGER ZONE
   ═══════════════════════════════════════════ */
.danger-zone {
    padding: 16px;
    background: var(--danger-light);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius);
}

.danger-zone h4 { margin-bottom: 8px; font-size: 0.95rem; }
.danger-zone p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 12px; }

/* ═══════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════ */
.pagination-wrapper {
    padding: 16px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 4px;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: var(--transition);
}

.page-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-link.active { background: var(--primary); color: #fff; }

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; opacity: 0.4; }
.empty-state p { font-size: 0.95rem; }

.empty-state-sm { padding: 16px; text-align: center; }

/* ═══════════════════════════════════════════
   GRID LAYOUT UTILITIES
   ═══════════════════════════════════════════ */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col-1  { flex: 0 0 calc(8.333% - 16px); min-width: 0; }
.col-2  { flex: 0 0 calc(16.666% - 16px); min-width: 0; }
.col-3  { flex: 0 0 calc(25% - 16px); min-width: 0; }
.col-4  { flex: 0 0 calc(33.333% - 16px); min-width: 0; }
.col-5  { flex: 0 0 calc(41.666% - 16px); min-width: 0; }
.col-6  { flex: 0 0 calc(50% - 8px); min-width: 0; }
.col-7  { flex: 0 0 calc(58.333% - 8px); min-width: 0; }
.col-8  { flex: 0 0 calc(66.666% - 8px); min-width: 0; }
.col-9  { flex: 0 0 calc(75% - 8px); min-width: 0; }
.col-12 { flex: 0 0 100%; }

/* ═══════════════════════════════════════════
   TEXT UTILITIES
   ═══════════════════════════════════════════ */
.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-info      { color: var(--info) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-right     { text-align: right !important; }
.text-center    { text-align: center !important; }
.text-sm        { font-size: 0.8rem !important; }
.text-link      { color: var(--primary); }
.text-link:hover { text-decoration: underline; }

.flex-1 { flex: 1; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.copy-btn { flex-shrink: 0; }

/* ═══════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════ */
.profile-page .card { margin-bottom: 24px; }

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.form-row .col-md-4 { flex: 0 0 calc(33.333% - 11px); }
.form-row .col-md-6 { flex: 0 0 calc(50% - 8px); }

.form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Dropdown divider */
.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sidebar { width: 70px; }
    .sidebar .sidebar-brand span,
    .sidebar .nav-section-title,
    .sidebar-nav a span,
    .sidebar-user span { display: none; }
    .main-content { margin-left: 70px; }
}

@media (max-width: 768px) {
    .row { flex-direction: column; }
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-12 { flex: 0 0 100%; }
    .server-tabs { flex-wrap: wrap; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* Scrollbar custom */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Filter form row */
.filter-form .row { align-items: flex-end; }

/* ═══════════════════════════════════════════
   SERVER DETAIL PAGE — Header
   ═══════════════════════════════════════════ */
.server-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 0;
}

.server-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.server-header-info h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.server-address {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Fira Code', 'Consolas', monospace;
}

.server-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   SERVER DETAIL PAGE — Status badges
   ═══════════════════════════════════════════ */
.server-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-status-badge.status-online {
    background: var(--success-light);
    color: var(--success);
}

.server-status-badge.status-offline {
    background: var(--danger-light);
    color: var(--danger);
}

.server-status-badge.status-starting {
    background: var(--warning-light);
    color: var(--warning);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: currentColor;
}

.server-status-badge.status-online .status-dot {
    box-shadow: 0 0 6px var(--success);
    animation: pulse 1.5s infinite;
}

.server-status-badge.status-starting .status-dot {
    animation: pulse 0.8s infinite;
}

/* ═══════════════════════════════════════════
   SERVER DETAIL PAGE — Live status
   ═══════════════════════════════════════════ */
.server-live-status {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.live-dot.live-online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.5s infinite;
}

.live-dot.live-offline {
    background: var(--danger);
}

/* ═══════════════════════════════════════════
   SERVER DETAIL PAGE — Mod line & Launch cmd
   ═══════════════════════════════════════════ */
.mod-line-display,
.launch-cmd-display {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.mod-line-display label {
    white-space: nowrap;
    flex-shrink: 0;
}

code.mod-line,
code.launch-cmd {
    flex: 1;
    background: none;
    padding: 0;
    font-size: 0.82rem;
    word-break: break-all;
    color: var(--success);
    line-height: 1.5;
}

code.path {
    word-break: break-all;
    font-size: 0.82rem;
}

/* ═══════════════════════════════════════════
   BADGE DEFAULT
   ═══════════════════════════════════════════ */
.badge-default {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   BTN LARGE
   ═══════════════════════════════════════════ */
.btn-lg {
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════
   FORM SECTIONS (create / edit server)
   ═══════════════════════════════════════════ */
.form-section {
    margin-bottom: 28px;
}

.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.form-grid .form-group {
    margin-bottom: 0;
}

/* Checkbox group inside forms */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   STATUS DOT VARIANTS (for index.php cards)
   ═══════════════════════════════════════════ */
.server-status.status-online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.server-status.status-offline { background: var(--danger); }

/* ═══════════════════════════════════════════
   CARD HEADER — flex between
   ═══════════════════════════════════════════ */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ═══════════════════════════════════════════
   DEPLOY WIZARD
   ═══════════════════════════════════════════ */

/* -- Étapes en haut -- */
.deploy-wizard { margin-top: 8px; }

.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 20px 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    cursor: default;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: all 0.4s ease;
}

.wizard-step.active .step-icon {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
}

.wizard-step.completed .step-icon {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.step-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
    transition: color 0.3s;
}

.wizard-step.active .step-label { color: var(--primary); font-weight: 600; }
.wizard-step.completed .step-label { color: var(--success); }

.wizard-connector {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 12px;
    margin-bottom: 28px;
    transition: background 0.4s ease;
    max-width: 120px;
}

.wizard-connector.completed {
    background: var(--success);
}

/* -- Panels -- */
.wizard-panel { animation: fadeSlideIn 0.3s ease; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 0 4px;
}

/* -- Game selector -- */
.game-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.game-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.game-card:hover:not(.disabled) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.game-card.selected {
    border-color: var(--success);
    background: var(--success-light);
}

.game-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-card img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.game-card-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
}

.game-card-info small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.game-check {
    position: absolute;
    right: 14px;
    top: 14px;
    color: var(--success);
    font-size: 1.2rem;
}

/* -- Validation icons inline -- */
.validation-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.85rem;
    vertical-align: middle;
}

/* -- Info banners -- */
.deploy-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--primary-light);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.deploy-info-banner > i {
    color: var(--primary);
    margin-top: 3px;
    font-size: 1.1rem;
}

.deploy-info-banner.info {
    background: var(--info-light);
    border-color: rgba(99, 102, 241, 0.25);
}

.deploy-info-banner.info > i { color: var(--info); }

.deploy-info-banner code {
    font-size: 0.85rem;
    word-break: break-all;
}

/* -- Port grid -- */
.port-config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* -- Summary -- */
.deploy-summary { margin-bottom: 20px; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.summary-label i {
    margin-right: 6px;
    width: 16px;
    text-align: center;
}

.summary-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

/* -- Progress section -- */
.deploy-progress-section {
    animation: fadeSlideIn 0.4s ease;
}

.deploy-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.deploy-progress-header i {
    color: var(--primary);
    font-size: 1.2rem;
}

.deploy-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.deploy-progress-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--primary);
    transition: width 0.5s ease;
    position: relative;
}

.deploy-progress-fill.downloading {
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    animation: progressPulse 2s ease infinite;
}

.deploy-progress-fill.installing {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.deploy-progress-fill.configuring {
    background: linear-gradient(90deg, var(--info), #818cf8);
}

.deploy-progress-fill.completed {
    background: var(--success);
}

.deploy-progress-fill.failed {
    background: var(--danger);
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.deploy-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

#deploy-progress-percent {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
}

/* -- Deploy log -- */
.deploy-log {
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
    background: #0d0f14;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
}

.log-entry {
    color: var(--text-secondary);
}

.log-time {
    color: var(--text-muted);
    margin-right: 4px;
}

/* -- Success & Error -- */
.deploy-success, .deploy-error {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    gap: 12px;
}

.deploy-success i {
    font-size: 3rem;
    color: var(--success);
    animation: scaleIn 0.5s ease;
}

.deploy-success h3 { color: var(--success); }

.deploy-error i {
    font-size: 3rem;
    color: var(--danger);
}

.deploy-error h3 { color: var(--danger); }

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* -- Deploy button -- */
.btn-deploy, .btn-success {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-deploy:hover, .btn-success:hover {
    background: #059669;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-deploy:disabled, .btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -- Badge -- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* -- Responsive wizard -- */
@media (max-width: 768px) {
    .wizard-steps {
        flex-wrap: wrap;
        gap: 10px;
        padding: 16px;
    }
    .wizard-connector { display: none; }
    .game-selector { flex-direction: column; }
    .port-config-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   TCADMIN — SERVICE DETAIL PAGE
   ═══════════════════════════════════════════ */

/* -- Breadcrumb -- */
.tc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.tc-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}
.tc-breadcrumb a:hover { color: var(--primary-hover); text-decoration: underline; }
.tc-breadcrumb i.fa-chevron-right { font-size: 0.6rem; color: var(--text-muted); }
.tc-breadcrumb span { color: var(--text-secondary); }

/* -- Manage bar -- */
.tc-manage-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.tc-manage-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tc-manage-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* -- Service Layout (sidebar + main) -- */
.tc-service-layout {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 420px;
}

/* -- Sidebar fonctions -- */
.tc-func-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}
.tc-func-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tc-func-item:hover {
    background: var(--bg-hover);
    border-left-color: var(--primary);
}
.tc-func-item.tc-func-active {
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}
.tc-func-item i {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.tc-func-item.tc-func-status {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    font-weight: 600;
}
.tc-func-item.tc-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.tc-func-item.tc-func-danger { color: var(--warning); }
.tc-func-item.tc-func-danger:hover { color: var(--danger); }

/* Sidebar icon colors (TCAdmin-style) */
.tc-icon-config  { color: #9ca3af; }
.tc-icon-cmd     { color: #60a5fa; }
.tc-icon-folder  { color: #f59e0b; }
.tc-icon-log     { color: #8b5cf6; }
.tc-icon-steam   { color: #60a5fa; }
.tc-icon-steam-green { color: #10b981; }
.tc-icon-steam-installed { color: #38bdf8; }
.tc-icon-steam-updates { color: #f97316; }
.tc-icon-mod     { color: #f472b6; }
.tc-icon-schedule { color: #ef4444; }
.tc-icon-stats   { color: #3b82f6; }
.tc-icon-backup  { color: #14b8a6; }
.tc-icon-wipe    { color: #eab308; }
.tc-icon-console { color: #a78bfa; }
.tc-icon-analyze { color: #22d3ee; }
.tc-icon-optimize { color: #f59e0b; }
/* DestiServCloud */
.tc-icon-dsc     { color: #e83b3b; }
.tc-ps-dsc       { border-left: 2px solid rgba(232,59,59,.5); }
.tc-ps-dsc:hover { border-left-color: #e83b3b; }
.tc-badge-dsc    {
    background: linear-gradient(135deg, #e83b3b, #ff6b35);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: auto;
}

/* Sidebar separator (catégorie Outils) */
.tc-ps-separator {
    padding: 12px 14px 4px;
    margin-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.tc-ps-separator-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.25);
    font-weight: 600;
}

/* Badge notification (sidebar) */
.tc-badge {
    font-size: 0.7em;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: auto;
    line-height: 1;
}
.tc-badge-update {
    background: #ef4444;
    color: #fff;
    animation: tc-badge-pulse 2s infinite;
}
.tc-badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
@keyframes tc-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Version label (next to game name) */
.tc-version-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78em;
    color: var(--text-muted, #a0aec0);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    padding: 3px 10px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Status indicator dot in sidebar */
.tc-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.tc-status-running  { background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulse 1.5s infinite; }
.tc-status-stopped  { background: var(--danger); }
.tc-status-starting { background: var(--warning); animation: pulse 0.8s infinite; }
.tc-status-stopping { background: var(--warning); }
.tc-status-error    { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; animation: pulse 1.5s infinite; }

/* -- Main content area -- */
.tc-main-content {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
}

/* When inline sidebar is removed (persistent sidebar handles navigation) */
.tc-service-layout.tc-no-inline-sidebar {
    display: block;
}
.tc-no-inline-sidebar .tc-main-content {
    padding: 24px 28px;
}

/* Service title */
.tc-service-title {
    margin-bottom: 24px;
}
.tc-service-title h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}
.tc-game-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* -- Info + Stats grid -- */
.tc-info-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

/* Connection block */
.tc-conn-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.tc-conn-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.tc-conn-row:last-of-type { border-bottom: none; }
.tc-conn-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tc-conn-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tc-conn-value code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}
.tc-pid {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}
.tc-uuid {
    font-size: 0.85rem;
    color: var(--accent-primary, #60a5fa);
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 1px;
    background: rgba(96, 165, 250, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Copy button */
.tc-copy {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8rem;
    transition: color 0.2s;
    flex-shrink: 0;
}
.tc-copy:hover { color: var(--primary); }

/* Action buttons row */
.tc-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.tc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.tc-btn-start {
    background: var(--success);
    color: #fff;
}
.tc-btn-start:hover {
    background: #059669;
    box-shadow: 0 0 10px rgba(16,185,129,0.3);
}
.tc-btn-stop {
    background: var(--danger);
    color: #fff;
}
.tc-btn-stop:hover {
    background: #dc2626;
    box-shadow: 0 0 10px rgba(239,68,68,0.3);
}
.tc-btn-restart {
    background: var(--warning);
    color: #000;
}
.tc-btn-restart:hover {
    background: #d97706;
}
.tc-btn-more {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.tc-btn-more:hover { background: var(--bg-hover); }
.tc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* Badge verrouillage lancement */
.tc-launch-locked-notice {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 14px; border-radius: 8px;
    background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35);
    color: #f59e0b; font-size: 0.82rem; font-weight: 500;
}
/* Boutons admin rapides (lock + DSC) */
.tc-admin-quick-actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    flex-wrap: wrap;
}
.tc-btn-lock {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 0.78rem; padding: 6px 12px;
}
.tc-btn-lock:hover { background: rgba(245,158,11,0.12); color: #f59e0b; border-color: rgba(245,158,11,0.4); }
.tc-btn-lock.active { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.5); }
.tc-btn-dsc-toggle {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 0.78rem; padding: 6px 12px;
}
.tc-btn-dsc-toggle:hover { background: rgba(99,102,241,0.12); color: #6366f1; border-color: rgba(99,102,241,0.4); }
.tc-btn-dsc-toggle.active { background: rgba(99,102,241,0.15); color: #6366f1; border-color: rgba(99,102,241,0.5); }

/* More dropdown */
.tc-more-wrap { position: relative; }
.tc-more-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
}
.tc-more-menu.show { display: block; }
.tc-more-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s;
}
.tc-more-menu a:hover { background: var(--bg-hover); }
.tc-more-menu a i { width: 16px; text-align: center; }
.tc-danger-link { color: var(--danger) !important; }
.tc-danger-link:hover { background: var(--danger-light) !important; }

/* -- Stats block -- */
.tc-stats-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tc-stat-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tc-stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.tc-stat-bar-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tc-stat-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.tc-stat-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}
.tc-fill-players { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.tc-fill-cpu     { background: linear-gradient(90deg, #10b981, #34d399); }
.tc-fill-ram     { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.tc-fill-disk    { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tc-stat-val {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: right;
}
.tc-stat-limit {
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Auto refresh toggle */
.tc-auto-refresh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.tc-toggle {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.tc-toggle input { display: none; }
.tc-toggle-track {
    display: block;
    width: 42px;
    height: 22px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 11px;
    position: relative;
    transition: background 0.25s;
}
.tc-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.25s;
}
.tc-toggle input:checked + .tc-toggle-track {
    background: var(--primary);
    border-color: var(--primary);
}
.tc-toggle input:checked + .tc-toggle-track .tc-toggle-thumb {
    left: 22px;
    background: #fff;
}

/* -- Details section below -- */
.tc-details-section {
    margin-top: 24px;
}

/* -- Responsive TCAdmin -- */
@media (max-width: 1024px) {
    .tc-service-layout { flex-direction: column; }
    .tc-func-sidebar {
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0;
    }
    .tc-func-item {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    .tc-func-item:hover,
    .tc-func-item.tc-func-active {
        border-left-color: transparent;
        border-bottom-color: var(--primary);
    }
    .tc-info-stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .tc-main-content { padding: 16px; }
    .tc-service-title h1 { font-size: 1.2rem; }
    .tc-action-buttons { flex-direction: column; }
    .tc-action-buttons .tc-btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════
   MODERN UI ENHANCEMENTS (v2)
   ═══════════════════════════════════════════ */

/* Cartes améliorées — glow subtil au hover */
.card {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    border-color: var(--border-light);
}

/* Boutons — effets de pression */
.btn {
    position: relative;
    overflow: hidden;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}
.btn-danger {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Stat cards — animation */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

/* Server cards — meilleur hover */
.server-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.server-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* Tables — hover stripe amélioré */
.table tbody tr {
    transition: background 0.15s ease;
}

/* Sidebar — glow effect sur item actif */
.sidebar-nav a.active {
    box-shadow: inset -3px 0 12px rgba(59, 130, 246, 0.1);
}

/* Input focus amélioré */
.form-control:focus {
    box-shadow: 0 0 0 3px var(--primary-light), 0 2px 8px rgba(59, 130, 246, 0.1);
}

/* Badge animation */
.badge {
    transition: all 0.2s ease;
}
.badge:hover {
    transform: scale(1.05);
}

/* Alert animation améliorée */
.alert {
    animation: slideInAlert 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideInAlert {
    from { opacity: 0; transform: translateY(-15px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Server tabs — glow actif */
.tab.active {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transition: all 0.3s ease;
}

/* Scrollbars modernes */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Focus visible (accessibilité) */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skeleton / loading placeholders */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Tooltip global */
[title] {
    position: relative;
}

/* Empty state global (réutilisable) */
.empty-state-modern {
    padding: 50px 20px;
    text-align: center;
}
.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: var(--primary);
}
.empty-state-modern h4 {
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 1.05rem;
}
.empty-state-modern p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Status badges réutilisables */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.status-active {
    background: var(--success-light);
    color: var(--success);
}
.status-inactive {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

/* Smooth page transitions */
.content-area {
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══════════════════════════════════════════
   PERSISTENT SERVER SIDEBAR (TCAdmin-style)
   À GAUCHE, juste après la sidebar navigation.
   Collapsed (icons-only 56px) → expand on hover (250px)
   ═══════════════════════════════════════════ */
.tc-sidebar-persistent {
    position: fixed;
    left: var(--sidebar-width);
    top: var(--header-height);
    width: 240px;
    height: calc(100vh - var(--header-height));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}
.tc-sidebar-persistent:hover {
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

/* Quand sidebar nav est collapsed (70px) */
body.sidebar-collapsed .tc-sidebar-persistent {
    left: 70px;
}

/* Scrollbar */
.tc-sidebar-persistent::-webkit-scrollbar { width: 4px; }
.tc-sidebar-persistent::-webkit-scrollbar-track { background: transparent; }
.tc-sidebar-persistent::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

/* Items */
.tc-ps-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 42px;
}
.tc-ps-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-left-color: var(--primary);
}
.tc-ps-item.tc-ps-active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}
.tc-ps-item i {
    width: 24px;
    min-width: 24px;
    text-align: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.tc-ps-item .tc-status-indicator {
    width: 14px;
    height: 14px;
    min-width: 14px;
    flex-shrink: 0;
    margin-left: 4px;
}

/* Labels — always visible */
.tc-ps-label {
    opacity: 1;
    font-size: 0.85rem;
}
.tc-sidebar-persistent:hover .tc-ps-label {
    opacity: 1;
}

/* Status bar (first item) */
.tc-ps-status {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--primary);
}

/* Disabled */
.tc-ps-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Danger */
.tc-ps-danger { color: var(--warning); }
.tc-ps-danger:hover { color: var(--danger); }

/* Badge (compact in collapsed, shown on expand) */
.tc-ps-badge {
    font-size: 0.65em;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: auto;
    line-height: 1;
    opacity: 1;
}
.tc-sidebar-persistent:hover .tc-ps-badge {
    opacity: 1;
}
/* Show badges even collapsed for update alerts */
.tc-ps-badge.tc-badge-update {
    background: #ef4444;
    color: #fff;
    opacity: 1;
    animation: tc-badge-pulse 2s infinite;
}
.tc-ps-badge.tc-badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Décaler le contenu principal quand la sidebar serveur est présente */
body.has-server-sidebar .main-content {
    margin-left: calc(var(--sidebar-width) + 240px);
}
body.has-server-sidebar.sidebar-collapsed .main-content {
    margin-left: calc(70px + 240px);
}

/* Responsive: hide on small screens */
@media (max-width: 1024px) {
    .tc-sidebar-persistent {
        display: none;
    }
    body.has-server-sidebar .main-content {
        margin-left: 70px;
    }
    body.has-server-sidebar.sidebar-collapsed .main-content {
        margin-left: 70px;
    }
}

/* ═══════════════════════════════════════════════
   Quick Nav Bar
   ═══════════════════════════════════════════════ */
.qn-bar { display:flex; align-items:center; gap:5px; flex-shrink:0; flex-wrap:wrap; padding:8px 20px; background:rgba(0,0,0,0.15); border-bottom:1px solid rgba(255,255,255,0.06); }
.qn-btn {
    display:inline-flex !important; align-items:center !important; gap:6px !important; padding:6px 14px !important;
    border-radius:20px !important; font-size:0.75rem !important; font-weight:700 !important;
    font-family:'Inter',sans-serif !important; text-decoration:none !important;
    border:none !important; transition:all .18s !important; white-space:nowrap !important; letter-spacing:.3px !important;
    color:#fff !important; text-transform:uppercase !important; box-shadow:0 2px 8px rgba(0,0,0,.35) !important;
    line-height:1 !important;
}
.qn-btn:hover { filter:brightness(1.15) !important; transform:translateY(-1px) !important; color:#fff !important; }
.qn-btn.qn-active { box-shadow:0 0 0 2px rgba(255,255,255,.4),0 3px 12px rgba(0,0,0,.4) !important; }
.qn-accueil { background:linear-gradient(135deg,#f97316,#ea580c); }
.qn-servers { background:linear-gradient(135deg,#3b82f6,#2563eb); }
.qn-bot     { background:linear-gradient(135deg,#ef4444,#dc2626); }
.qn-dash    { background:linear-gradient(135deg,#10b981,#059669); }
.qn-users   { background:linear-gradient(135deg,#f59e0b,#d97706); }
.qn-agent   { background:linear-gradient(135deg,#8b5cf6,#7c3aed); }
.qn-admin   { background:linear-gradient(135deg,#6366f1,#4f46e5); }

/* ═══════════════════════════════════════════════
   Bouton Kill / Forcer arrêt
   ═══════════════════════════════════════════════ */
.tc-btn-kill {
    background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
    color: #fff !important;
    border: none !important;
}
.tc-btn-kill:hover { filter: brightness(1.15); }
.btn-kill {
    background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
    color: #fff !important;
    border: none !important;
}
.btn-kill:hover { filter: brightness(1.15); }
