/* Gestionnaire de Site — GitHub Dark Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #0d1117;
    color: #e6edf3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.navbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: #e6edf3;
}
.navbar-brand span { color: #58a6ff; }
.navbar-links { display: flex; gap: 16px; }
.navbar-links a {
    color: #8b949e;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.navbar-links a:hover, .navbar-links a.active {
    color: #e6edf3;
    background: #21262d;
    text-decoration: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Typography */
.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}
.page-title span { color: #58a6ff; }
.page-subtitle {
    color: #8b949e;
    font-size: 14px;
    margin-bottom: 32px;
}
.text-muted { color: #8b949e; font-size: 14px; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #58a6ff;
}
.stat-label {
    font-size: 12px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Section */
.section {
    margin-bottom: 32px;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b949e;
    margin-bottom: 16px;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Cards */
.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: border-color 0.2s, transform 0.2s;
    cursor: pointer;
}
.card:hover {
    border-color: #58a6ff;
    transform: translateY(-2px);
    text-decoration: none;
}
.card-icon { font-size: 28px; flex-shrink: 0; }
.card-content { flex: 1; min-width: 0; }
.card-name {
    font-size: 15px;
    font-weight: 600;
    color: #e6edf3;
    margin-bottom: 4px;
}
.card-desc {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 6px;
}
.card-url {
    font-size: 12px;
    color: #58a6ff;
}

/* Badges */
.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-prod { background: #23863622; color: #3fb950; }
.badge-tool { background: #d9770622; color: #d97706; }
.badge-infra { background: #8957e522; color: #a371f7; }
.badge-danger { background: #f8514922; color: #f85149; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #30363d;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background: #238636;
    color: #fff;
    border-color: #238636;
}
.btn-primary:hover { background: #2ea043; text-decoration: none; }
.btn-secondary {
    background: #21262d;
    color: #e6edf3;
}
.btn-secondary:hover { background: #30363d; }
.btn-danger {
    background: #da363322;
    color: #f85149;
    border-color: #f8514944;
}
.btn-danger:hover { background: #da363344; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #30363d;
    color: #8b949e;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #21262d;
}
.table tr:hover td { background: #161b22; }

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #8b949e;
    margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 14px;
    font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px #58a6ff22;
}
.form-textarea { min-height: 80px; resize: vertical; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: #0d1117cc;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #30363d;
    border: 1px solid #484f58;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease;
    max-width: 400px;
}
.toast.success { background: #238636; border-color: #2ea043; }
.toast.error { background: #da3633; border-color: #f85149; }
.toast.info { background: #1f6feb; border-color: #388bfd; }
.toast.fadeout { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* Confirm dialog */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13,17,23,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.confirm-dialog {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}
.confirm-dialog p {
    margin-bottom: 20px;
    font-size: 15px;
}
.confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* User menu in navbar */
.navbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.navbar-user .username {
    color: #e6edf3;
    font-weight: 600;
}
.navbar-user .role-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    background: #58a6ff22;
    color: #58a6ff;
    text-transform: uppercase;
}
.navbar-user .btn-logout {
    padding: 4px 10px;
    font-size: 12px;
    color: #8b949e;
    background: none;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.navbar-user .btn-logout:hover {
    color: #f85149;
    border-color: #f85149;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #30363d;
    margin-bottom: 24px;
}
.tab {
    padding: 10px 20px;
    color: #8b949e;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab:hover { color: #e6edf3; }
.tab.active { color: #58a6ff; border-bottom-color: #58a6ff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Color swatch */
.color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.color-row label {
    width: 140px;
    font-size: 13px;
    color: #8b949e;
}
.color-row input[type="color"] {
    width: 40px;
    height: 32px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: none;
    cursor: pointer;
}
.color-row .color-value {
    font-size: 12px;
    color: #6e7681;
    font-family: monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid { grid-template-columns: 1fr; }
    .navbar { flex-wrap: wrap; gap: 12px; }
    .navbar-user { margin-left: 0; }
    .tabs { overflow-x: auto; }
}
