/* ============================================
   MONASSUR.FR — BACKOFFICE / CLIENT AREA
   Style moderne, sobre, productif
   ============================================ */

:root {
    --bo-bg: #f7f8fa;
    --bo-card: #ffffff;
    --bo-border: #e5e7eb;
    --bo-text: #111827;
    --bo-text-soft: #6b7280;
    --bo-text-light: #9ca3af;
    --bo-primary: #000000;
    --bo-accent: #d6fc51;
    --bo-success: #10b981;
    --bo-warning: #f59e0b;
    --bo-danger: #ef4444;
    --bo-info: #3b82f6;
    --bo-purple: #8b5cf6;
    --bo-radius: 12px;
    --bo-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
    --bo-shadow-lg: 0 10px 30px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bo-bg);
    color: var(--bo-text);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
img, svg { display: block; max-width: 100%; }

/* ============ LAYOUT ============ */
.bo-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.bo-sidebar {
    background: var(--bo-primary);
    color: #fff;
    padding: 28px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.bo-sidebar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    padding: 0 24px 28px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 24px;
}
.bo-sidebar .logo-mark {
    width: 36px;
    height: 36px;
    background: var(--bo-accent);
    color: #000;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 900;
}
.bo-sidebar .dot { color: var(--bo-accent); }

.bo-nav {
    list-style: none;
    padding: 0 14px;
}
.bo-nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,.4);
    padding: 18px 12px 8px;
    font-weight: 700;
}
.bo-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,.7);
    font-weight: 500;
    transition: all .15s;
    margin-bottom: 2px;
}
.bo-nav a:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}
.bo-nav a.active {
    background: rgba(214,252,81,.12);
    color: var(--bo-accent);
}
.bo-nav svg { flex-shrink: 0; width: 18px; height: 18px; }
.bo-nav .badge {
    margin-left: auto;
    background: var(--bo-accent);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
}

/* ============ MAIN ============ */
.bo-main {
    padding: 24px 32px;
    min-width: 0;
}

.bo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.bo-topbar h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.bo-topbar .muted {
    color: var(--bo-text-soft);
    font-size: 13px;
    margin-top: 4px;
}
.bo-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bo-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bo-card);
    border: 1px solid var(--bo-border);
    border-radius: 999px;
}
.bo-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bo-primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
}

/* ============ CARD ============ */
.bo-card {
    background: var(--bo-card);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius);
    box-shadow: var(--bo-shadow);
}
.bo-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--bo-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bo-card-header h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.bo-card-body {
    padding: 24px;
}
.bo-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--bo-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafbfc;
    border-radius: 0 0 var(--bo-radius) var(--bo-radius);
}

/* ============ STATS ============ */
.bo-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}
.bo-stat {
    background: var(--bo-card);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius);
    padding: 22px 24px;
}
.bo-stat-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--bo-text-soft);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.bo-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--bo-bg);
    display: grid;
    place-items: center;
    color: var(--bo-text);
}
.bo-stat-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.bo-stat-trend {
    font-size: 12px;
    margin-top: 8px;
    color: var(--bo-text-soft);
}
.bo-stat-trend.up { color: var(--bo-success); }
.bo-stat-trend.down { color: var(--bo-danger); }

/* ============ TABLE ============ */
.bo-table {
    width: 100%;
    border-collapse: collapse;
}
.bo-table th,
.bo-table td {
    padding: 14px 24px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--bo-border);
}
.bo-table th {
    font-weight: 600;
    color: var(--bo-text-soft);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #fafbfc;
}
.bo-table tbody tr {
    transition: background .12s;
}
.bo-table tbody tr:hover {
    background: #fafbfc;
}
.bo-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============ BADGE ============ */
.bo-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}
.bo-badge.gray   { background: #f3f4f6; color: #6b7280; }
.bo-badge.blue   { background: #dbeafe; color: #1e40af; }
.bo-badge.green  { background: #d1fae5; color: #065f46; }
.bo-badge.orange { background: #fed7aa; color: #9a3412; }
.bo-badge.red    { background: #fee2e2; color: #991b1b; }
.bo-badge.purple { background: #ede9fe; color: #5b21b6; }
.bo-badge.yellow { background: #fef3c7; color: #92400e; }

/* ============ BUTTONS ============ */
.bo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
    border: 1px solid transparent;
    white-space: nowrap;
}
.bo-btn-primary {
    background: var(--bo-primary);
    color: #fff;
}
.bo-btn-primary:hover {
    background: #1f2937;
    transform: translateY(-1px);
}
.bo-btn-accent {
    background: var(--bo-accent);
    color: #000;
}
.bo-btn-accent:hover {
    background: #b8e332;
}
.bo-btn-ghost {
    background: transparent;
    color: var(--bo-text);
    border-color: var(--bo-border);
}
.bo-btn-ghost:hover {
    background: var(--bo-bg);
}
.bo-btn-danger {
    background: var(--bo-danger);
    color: #fff;
}
.bo-btn-danger:hover {
    background: #dc2626;
}
.bo-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.bo-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* ============ FORM ============ */
.bo-form-group {
    margin-bottom: 18px;
}
.bo-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--bo-text);
    margin-bottom: 6px;
}
.bo-form-group .help {
    font-size: 12px;
    color: var(--bo-text-soft);
    margin-top: 4px;
}
.bo-input,
.bo-select,
.bo-textarea {
    width: 100%;
    padding: 11px 14px;
    background: #fff;
    border: 1px solid var(--bo-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--bo-text);
    transition: all .15s;
}
.bo-input:focus,
.bo-select:focus,
.bo-textarea:focus {
    outline: none;
    border-color: var(--bo-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,.05);
}
.bo-textarea {
    resize: vertical;
    min-height: 100px;
}
.bo-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.bo-form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ============ LOGIN ============ */
.bo-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--bo-bg);
    padding: 20px;
}
.bo-login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: var(--bo-shadow-lg);
    border: 1px solid var(--bo-border);
}
.bo-login-card .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 22px;
    margin-bottom: 8px;
}
.bo-login-card .logo-mark {
    width: 40px;
    height: 40px;
    background: #000;
    color: #fff;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 900;
}
.bo-login-card .dot { color: var(--bo-success); }
.bo-login-card h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 24px 0 6px;
}
.bo-login-card p.subtitle {
    color: var(--bo-text-soft);
    font-size: 14px;
    margin-bottom: 28px;
}

/* ============ FLASH ============ */
.bo-flash {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.bo-flash.success { background: #d1fae5; color: #065f46; }
.bo-flash.error   { background: #fee2e2; color: #991b1b; }
.bo-flash.warning { background: #fef3c7; color: #92400e; }
.bo-flash.info    { background: #dbeafe; color: #1e40af; }

/* ============ EMPTY STATE ============ */
.bo-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--bo-text-soft);
}
.bo-empty svg {
    margin: 0 auto 14px;
    color: var(--bo-text-light);
}
.bo-empty h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--bo-text);
    margin-bottom: 6px;
}

/* ============ PAGE EDIT ============ */
.bo-page-edit {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
.bo-side-card {
    position: sticky;
    top: 24px;
}

/* ============ TOOLBAR ============ */
.bo-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    align-items: center;
}
.bo-search {
    position: relative;
    flex: 1;
    max-width: 360px;
}
.bo-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: #fff;
    border: 1px solid var(--bo-border);
    border-radius: 8px;
    font-size: 13px;
}
.bo-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bo-text-soft);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .bo-wrap { grid-template-columns: 1fr; }
    .bo-sidebar { position: relative; height: auto; }
    .bo-stats { grid-template-columns: repeat(2, 1fr); }
    .bo-page-edit { grid-template-columns: 1fr; }
    .bo-form-row, .bo-form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .bo-main { padding: 16px; }
    .bo-stats { grid-template-columns: 1fr; }
    .bo-table th, .bo-table td { padding: 10px 14px; }
}
