/* ===== Admin CSS — Générateur de sites partenaires ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --sidebar-bg: #1e3a5f;
    --sidebar-w: 250px;
    --primary: #1a56db;
    --primary-dark: #1644b0;
    --success: #16a34a;
    --danger: #dc2626;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body { font-family: 'Inter', sans-serif; background: var(--gray-50); color: var(--gray-900); }

/* Sidebar */
.admin-body { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 1.3rem; font-weight: 700; }
.sidebar-subtitle { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.5rem; color: rgba(255,255,255,0.7); text-decoration: none; transition: all 0.2s; font-size: 0.9rem; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item svg { flex-shrink: 0; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; display: flex; justify-content: space-between; align-items: center; }
.logout-link { color: rgba(255,255,255,0.6); text-decoration: none; }
.logout-link:hover { color: #fff; }

/* Main content */
.main-content { flex: 1; margin-left: var(--sidebar-w); }
.top-header { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; }
.top-header h1 { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--gray-700); }
.content-area { padding: 2rem; }

/* Alerts */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius); margin: 0 2rem 0; font-size: 0.9rem; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* Dashboard stats */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--gray-500); margin-top: 0.25rem; }

/* Section header */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.1rem; font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-500); }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* Partners grid */
.partners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.partner-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.partner-card-header { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.85rem; }
.partner-logo { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: var(--gray-50); }
.partner-logo-placeholder { width: 44px; height: 44px; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.partner-card-header h3 { font-size: 1rem; font-weight: 600; }
.partner-slug { font-size: 0.8rem; color: var(--gray-500); }
.partner-card-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }
.badge { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #f0fdf4; color: var(--success); }
.badge-draft { background: var(--gray-100); color: var(--gray-500); }
.date { font-size: 0.8rem; color: var(--gray-500); }
.partner-card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-state p { margin: 1rem 0; color: var(--gray-500); }

/* Form */
.partner-form { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--gray-200); padding: 0 1rem; background: #fff; border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 0; z-index: 10; }
.tab-btn { padding: 0.85rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; font-size: 0.85rem; font-weight: 500; color: var(--gray-500); cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.tab-btn:hover { color: var(--gray-700); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; padding: 1.5rem; }
.tab-content.active { display: block; }
.form-section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--gray-900); }
.form-section-title small { font-weight: 400; color: var(--gray-500); font-size: 0.85rem; }
.form-subsection { font-size: 0.95rem; font-weight: 600; margin: 1.25rem 0 0.75rem; color: var(--gray-700); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; font-size: 0.85rem; color: var(--gray-700); margin-bottom: 0.3rem; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 0.9rem; font-family: inherit; transition: border-color 0.2s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.form-group input[type="file"] { padding: 0.4rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-actions { padding: 1.25rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* Color input */
.color-input { display: flex; align-items: center; gap: 0.75rem; }
.color-input input[type="color"] { width: 48px; height: 38px; border: 1px solid var(--gray-300); border-radius: var(--radius); cursor: pointer; padding: 2px; }
.color-value { font-size: 0.9rem; color: var(--gray-500); font-family: monospace; }

/* Logo preview */
.logo-preview { margin-top: 0.5rem; }
.logo-preview img { max-width: 150px; max-height: 80px; border-radius: var(--radius); background: var(--gray-50); padding: 0.25rem; }

/* Repeatable items */
.repeatable-container { margin-bottom: 1rem; }
.repeatable-item { position: relative; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
.btn-remove { position: absolute; top: 0.5rem; right: 0.5rem; background: none; border: none; color: var(--danger); font-size: 1.3rem; cursor: pointer; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.btn-remove:hover { background: #fef2f2; }
.btn-add { margin-top: 0.5rem; }

/* Char count */
.char-count { font-weight: 400; font-size: 0.8rem; color: var(--gray-500); }

/* FTP Deploy */
.ftp-deploy-container { max-width: 600px; }
.ftp-info { margin-bottom: 1.5rem; color: var(--gray-700); }
.ftp-form { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.ftp-progress { margin-bottom: 1.5rem; }
.progress-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.5s ease; width: 0; }
.ftp-status { font-size: 0.9rem; color: var(--gray-700); }
.ftp-status.success { color: var(--success); }
.ftp-status.error { color: var(--danger); }
.ftp-log { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.ftp-log h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }
.ftp-log pre { background: var(--gray-900); color: #e2e8f0; padding: 1rem; border-radius: var(--radius); font-size: 0.8rem; overflow-x: auto; max-height: 300px; overflow-y: auto; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .content-area { padding: 1rem; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .partners-grid { grid-template-columns: 1fr; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .form-tabs { padding: 0 0.5rem; }
    .tab-btn { padding: 0.7rem 0.6rem; font-size: 0.78rem; }
}
