/* === Facturation NC — Style === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #f4f6f9;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 0 20px;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-brand {
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 5px;
}
.nav-links li a {
    color: #ddd;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.2s;
}
.nav-links li a:hover {
    background: #34495e;
    color: white;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    flex: 1;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card h2 {
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #2c3e50;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}
.stat-label {
    display: block;
    color: #7f8c8d;
    margin-top: 5px;
}
.stat-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9em;
}
.stat-card-accueil .stat-number { color: #27ae60; }

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.page-header h1 { font-size: 1.5em; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.table thead th {
    background: #2c3e50;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #ecf0f1;
}
.table tbody tr:hover {
    background: #f8f9fa;
}
.table tbody tr:last-child td {
    border-bottom: none;
}

/* Forms */
.form { background: white; padding: 25px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 0.9em; color: #555; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 2px rgba(52,152,219,0.2); }
textarea.form-control { resize: vertical; min-height: 60px; }
select.form-control { appearance: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}
.btn:hover { background: #f0f0f0; }
.btn-primary { background: #3498db; color: white; border-color: #3498db; }
.btn-primary:hover { background: #2980b9; }
.btn-success { background: #27ae60; color: white; border-color: #27ae60; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; color: white; border-color: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #f39c12; color: white; border-color: #f39c12; }
.btn-warning:hover { background: #d68910; }
.btn-sm { padding: 4px 10px; font-size: 0.8em; }
.btn-block { width: 100%; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}
.badge-brouillon { background: #ecf0f1; color: #7f8c8d; }
.badge-envoye, .badge-envoyee { background: #d6eaf8; color: #2980b9; }
.badge-accepte, .badge-payee { background: #d5f5e3; color: #27ae60; }
.badge-refuse, .badge-impayee { background: #fadbd8; color: #e74c3c; }

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
}
.alert-info { background: #d6eaf8; color: #2980b9; border: 1px solid #aed6f1; }
.alert-danger { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }
.alert-success { background: #d5f5e3; color: #27ae60; border: 1px solid #a9dfbf; }

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}
.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}
.login-card h1 {
    text-align: center;
    margin-bottom: 5px;
    color: #2c3e50;
}
.login-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 0.9em;
}
.login-form .form-group { margin-bottom: 20px; }

/* Dashboard */
.dashboard-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.dashboard-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.dash-section h2 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Totals */
.totals {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 6px;
    margin: 15px 0;
    text-align: right;
}
.totals p { margin: 3px 0; font-size: 1em; }
.totals .ttc { font-size: 1.3em; color: #27ae60; }

/* Actions column */
.actions { white-space: nowrap; }
.actions .btn { margin-right: 3px; }

/* Footer */
.footer {
    text-align: center;
    padding: 15px;
    color: #95a5a6;
    font-size: 0.85em;
    margin-top: 30px;
}

/* Text */
.text-muted { color: #95a5a6; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .dashboard-lists { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}