/* ============================================
   TrezoFoot v3.5 Web — Stylesheet
   Theme: Football Green & Gold
   ============================================ */

:root {
    --tf-green: #0d5c2e;
    --tf-green-light: #17804a;
    --tf-green-dark: #082e17;
    --tf-gold: #d4a843;
    --tf-gold-light: #f0cd6e;
    --tf-gold-dark: #b08a2a;
    --tf-bg: #0c1117;
    --tf-bg-card: #151c25;
    --tf-bg-card-hover: #1a2332;
    --tf-border: #1e2a3a;
    --tf-text: #e2e8f0;
    --tf-text-muted: #8493a8;
    --tf-red: #e74c3c;
    --tf-blue: #3498db;
    --tf-sidebar-w: 260px;
    --tf-radius: 12px;
    --tf-radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--tf-bg);
    color: var(--tf-text);
    margin: 0;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--tf-sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--tf-green-dark) 0%, #0a1a10 100%);
    border-right: 1px solid rgba(212, 168, 67, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.4));
}

.brand-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--tf-gold-light), var(--tf-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    list-style: none;
    padding: 16px 12px;
    margin: 0;
    flex: 1;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: var(--tf-radius-sm);
    font-weight: 500;
    font-size: 14.5px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.06);
}

.sidebar-nav .nav-link.active {
    color: var(--tf-gold-light);
    background: rgba(212, 168, 67, 0.12);
    border: 1px solid rgba(212, 168, 67, 0.2);
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* ============================================
   MOBILE HEADER
   ============================================ */
.mobile-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--tf-green-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 999;
    border-bottom: 1px solid rgba(212, 168, 67, 0.2);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show { display: block; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--tf-sidebar-w);
    padding: 32px;
    min-height: 100vh;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.page-header .subtitle {
    color: var(--tf-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ============================================
   CARDS
   ============================================ */
.tf-card {
    background: var(--tf-bg-card);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 24px;
    transition: border-color 0.2s;
}

.tf-card:hover {
    border-color: rgba(212, 168, 67, 0.2);
}

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

.tf-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    background: var(--tf-bg-card);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--tf-green-light);
}

.stat-card.gold::before { background: var(--tf-gold); }
.stat-card.red::before { background: var(--tf-red); }
.stat-card.blue::before { background: var(--tf-blue); }

.stat-card .stat-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-card .stat-detail {
    font-size: 12px;
    color: var(--tf-text-muted);
    margin-top: 4px;
}

.stat-positive { color: #2ecc71; }
.stat-negative { color: #e74c3c; }

/* ============================================
   TABLES
   ============================================ */
.tf-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tf-table thead th {
    background: rgba(255,255,255,0.03);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--tf-text-muted);
    border-bottom: 1px solid var(--tf-border);
    text-align: left;
}

.tf-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

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

.tf-table .money {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.tf-table .money.positive { color: #2ecc71; }
.tf-table .money.negative { color: #e74c3c; }

/* ============================================
   BADGES
   ============================================ */
.badge-actif {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-inactif {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-termine {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-encours {
    background: rgba(212, 168, 67, 0.15);
    color: var(--tf-gold);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-jeu {
    background: rgba(13, 92, 46, 0.3);
    color: #2ecc71;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-tf {
    background: linear-gradient(135deg, var(--tf-green), var(--tf-green-light));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--tf-radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-tf:hover {
    background: linear-gradient(135deg, var(--tf-green-light), #1d9956);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(13, 92, 46, 0.4);
}

.btn-tf-gold {
    background: linear-gradient(135deg, var(--tf-gold-dark), var(--tf-gold));
    color: #1a1a1a;
    border: none;
    padding: 10px 20px;
    border-radius: var(--tf-radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-tf-gold:hover {
    background: linear-gradient(135deg, var(--tf-gold), var(--tf-gold-light));
    color: #1a1a1a;
    transform: translateY(-1px);
}

.btn-tf-outline {
    background: transparent;
    color: var(--tf-text);
    border: 1px solid var(--tf-border);
    padding: 10px 20px;
    border-radius: var(--tf-radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-tf-outline:hover {
    border-color: var(--tf-gold);
    color: var(--tf-gold);
    background: rgba(212, 168, 67, 0.05);
}

.btn-tf-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    padding: 10px 20px;
    border-radius: var(--tf-radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-tf-danger:hover {
    background: #e74c3c;
    color: white;
}

/* ============================================
   FORMS
   ============================================ */
.tf-input, .tf-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--tf-border);
    color: var(--tf-text);
    padding: 10px 14px;
    border-radius: var(--tf-radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s;
}

.tf-input:focus, .tf-select:focus {
    outline: none;
    border-color: var(--tf-gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
}

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

.tf-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tf-text-muted);
    margin-bottom: 6px;
}

/* ============================================
   MODAL OVERRIDES
   ============================================ */
.modal-content {
    background: var(--tf-bg-card);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
}

.modal-header {
    border-bottom: 1px solid var(--tf-border);
    padding: 20px 24px;
}

.modal-title {
    font-weight: 700;
    font-size: 18px;
}

.modal-body { padding: 24px; }

.modal-footer {
    border-top: 1px solid var(--tf-border);
    padding: 16px 24px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 30% 20%, rgba(13, 92, 46, 0.2) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(212, 168, 67, 0.08) 0%, transparent 60%),
                var(--tf-bg);
}

.login-card {
    background: var(--tf-bg-card);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.login-card .brand-icon { font-size: 48px; }
.login-card .brand-text { font-size: 32px; }

.login-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 10px 14px;
    border-radius: var(--tf-radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--tf-text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 20px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.tf-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.tf-toast {
    background: var(--tf-bg-card);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius-sm);
    padding: 14px 20px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideInRight 0.3s ease;
    min-width: 280px;
}

.tf-toast.success { border-left: 3px solid #2ecc71; }
.tf-toast.error { border-left: 3px solid #e74c3c; }
.tf-toast.info { border-left: 3px solid #3498db; }

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 72px;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
    .page-header h1 {
        font-size: 22px;
    }
}

@media (max-width: 575.98px) {
    .main-content { padding: 12px; padding-top: 68px; }
    .tf-card { padding: 16px; }
    .tf-table { font-size: 13px; }
    .tf-table thead th, .tf-table tbody td { padding: 10px 8px; }
    .login-card { padding: 32px 24px; margin: 12px; }
}

/* ============================================
   INSTALL PAGE
   ============================================ */
.install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tf-bg);
    padding: 20px;
}

.install-card {
    background: var(--tf-bg-card);
    border: 1px solid var(--tf-border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
}

.install-step .step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.install-step .step-icon.done {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.install-step .step-icon.fail {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.install-step .step-icon.pending {
    background: rgba(255,255,255,0.1);
    color: var(--tf-text-muted);
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
