/* BreadCamp - Feuille de style principale */

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --amber-50:  #fffbeb;
    --amber-100: #fef3c7;
    --amber-200: #fde68a;
    --amber-700: #b45309;
    --amber-800: #92400e;
    --gray-100:  #f3f4f6;
    --gray-200:  #e5e7eb;
    --gray-400:  #9ca3af;
    --gray-500:  #6b7280;
    --gray-700:  #374151;
    --gray-900:  #111827;
    --green-100: #dcfce7;
    --green-700: #15803d;
    --red-100:   #fee2e2;
    --red-700:   #b91c1c;
    --white:     #ffffff;
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,0.08);
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--amber-50);
}

/* ── Layout helpers ───────────────────────────────────────────── */
.bg-cream       { background: var(--amber-50); }
.min-h-screen   { min-height: 100vh; }
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-center { justify-content: center; }
.p-4            { padding: 1rem; }
.mt-2  { margin-top: .5rem; }
.mt-3  { margin-top: .75rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }
.space-y-2 > * + * { margin-top: .5rem; }
.text-center { text-align: center; }
.text-xs  { font-size: .75rem; }
.text-sm  { font-size: .875rem; }
.text-xl  { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold   { font-weight: 700; }
.text-amber-700 { color: var(--amber-700); }
.text-amber-800 { color: var(--amber-800); }
.text-gray-400  { color: var(--gray-400); }
.text-gray-500  { color: var(--gray-500); }
.text-red-700   { color: var(--red-700); }
.w-full { width: 100%; }
.inline-block { display: inline-block; }
.max-w-sm  { max-width: 420px; }
.max-w-md  { max-width: 520px; }

/* ── Card ─────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 1.75rem;
    width: 100%;
}

.logo-icon { font-size: 2.5rem; }

/* ── Formulaires ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .35rem;
}

.required { color: var(--red-700); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: .6rem .85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    font-size: .95rem;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color .15s;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--amber-700);
    box-shadow: 0 0 0 3px rgba(180,83,9,.12);
}

.input-with-icon {
    position: relative;
}
.input-with-icon input { padding-right: 2.5rem; }
.input-with-icon .icon-btn {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gray-400);
    padding: .2rem;
}

/* ── Boutons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1.25rem;
    border-radius: 7px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
}
.btn:hover { opacity: .88; }

.btn-primary   { background: var(--amber-700); color: var(--white); }
.btn-secondary { background: var(--amber-100); color: var(--amber-800); border: 1.5px solid var(--amber-200); }
.btn-danger    { background: var(--red-100);   color: var(--red-700);   border: 1.5px solid #fca5a5; }
.btn-sm        { padding: .4rem .85rem; font-size: .85rem; }
.btn-icon      { padding: .5rem; border-radius: 6px; }

/* ── Alertes ──────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: 7px;
    font-size: .9rem;
}
.alert-success { background: var(--green-100); color: var(--green-700); }
.alert-error   { background: var(--red-100);   color: var(--red-700); }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
    background: var(--white);
    border-bottom: 1.5px solid var(--gray-200);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--amber-800);
    text-decoration: none;
}
.navbar-nav {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ── Table admin ──────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--white);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
th {
    background: var(--amber-100);
    color: var(--amber-800);
    font-weight: 700;
    padding: .75rem 1rem;
    text-align: left;
    white-space: nowrap;
}
td {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
tr:hover td { background: var(--amber-50); }
tr:last-child td { border-bottom: none; }

/* ── Statuts commande ─────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .25rem .6rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
}
.badge-waiting  { background: var(--amber-100); color: var(--amber-800); }
.badge-sent     { background: #dbeafe; color: #1e40af; }
.badge-ready    { background: var(--green-100); color: var(--green-700); }
.badge-canceled { background: var(--gray-100); color: var(--gray-500); }
.badge-paid     { background: var(--green-100); color: var(--green-700); }
.badge-unpaid   { background: var(--red-100);   color: var(--red-700); }

/* ── Catalogue produits ───────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    padding: 1rem;
}
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.product-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.product-card .product-info {
    padding: .65rem;
}
.product-card .product-name  { font-weight: 600; font-size: .9rem; }
.product-card .product-price { color: var(--amber-700); font-weight: 700; margin-top: .2rem; }

/* ── Panier ───────────────────────────────────────────────────── */
.cart-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.qty-control {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background .12s;
}
.qty-btn:hover { background: var(--amber-100); }
.qty-value { font-weight: 700; min-width: 24px; text-align: center; }

/* ── Séparateur ───────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--gray-200); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .card { padding: 1.5rem 1.25rem; }
    .form-row { grid-template-columns: 1fr; }
}

/* ── Print (bon de commande) ──────────────────────────────────── */
@media print {
    .navbar, .btn, .no-print { display: none !important; }
    body { background: white; }
    .card { box-shadow: none; }
}
