/* ============================================================
   CompliChef France Kitchen Portal v2 — Main Stylesheet
   Dark theme, Bootstrap 5.3 base
   ============================================================ */

:root {
    --cc-bg:           #0d1117;
    --cc-surface:      #161b22;
    --cc-surface2:     #1f2937;
    --cc-border:       #30363d;
    --cc-text:         #e6edf3;
    --cc-text-muted:   #7d8590;
    --cc-primary:      #2563eb;
    --cc-primary-h:    #1d4ed8;
    --cc-success:      #16a34a;
    --cc-warning:      #d97706;
    --cc-danger:       #dc2626;
    --cc-info:         #0891b2;
    --cc-accent:       #34d399;
    --cc-sidebar-w:    260px;
    --cc-navbar-h:     56px;
    --cc-radius:       8px;
    --cc-radius-lg:    12px;
}

/* ── Base ─────────────────────────────────────────────────── */

body {
    background-color: var(--cc-bg);
    color: var(--cc-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9375rem;
    min-height: 100vh;
}

a { color: #60a5fa; }
a:hover { color: #93c5fd; }

/* ── Navbar ───────────────────────────────────────────────── */

.cc-navbar {
    background: var(--cc-surface) !important;
    border-bottom: 1px solid var(--cc-border);
    height: var(--cc-navbar-h);
    z-index: 1040;
}

.cc-brand {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}
.brand-compli { color: #60a5fa; }
.brand-chef   { color: var(--cc-accent); }
.brand-flag   { font-size: 1rem; }

.cc-org-name {
    font-size: 0.875rem;
    color: var(--cc-text-muted);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.cc-avatar-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cc-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.cc-page-wrapper {
    min-height: calc(100vh - var(--cc-navbar-h));
}

.cc-sidebar {
    width: var(--cc-sidebar-w);
    min-width: var(--cc-sidebar-w);
    background: var(--cc-surface);
    border-right: 1px solid var(--cc-border);
    overflow-y: auto;
    height: calc(100vh - var(--cc-navbar-h));
    position: sticky;
    top: var(--cc-navbar-h);
}

.cc-sidebar-nav {
    padding: 0.75rem 0;
}

.cc-sidebar-nav .nav-header {
    list-style: none;
    padding: 1rem 1rem 0.25rem;
}
.cc-sidebar-nav .nav-header span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cc-text-muted);
}

.cc-nav-link {
    color: var(--cc-text-muted);
    padding: 0.45rem 1rem;
    border-radius: var(--cc-radius);
    margin: 0 0.5rem;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cc-nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--cc-text);
}
.cc-nav-link.active {
    background: rgba(37,99,235,0.2);
    color: #60a5fa !important;
}

/* ── Main Content ─────────────────────────────────────────── */

.cc-main-content {
    min-width: 0;
    background: var(--cc-bg);
}

.cc-page-header {
    border-bottom: 1px solid var(--cc-border);
    padding-bottom: 1rem;
}
.cc-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cc-text);
    margin: 0;
}

/* ── Cards ────────────────────────────────────────────────── */

.card {
    background: var(--cc-surface2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
}
.card-header {
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--cc-border);
    font-weight: 600;
    font-size: 0.9375rem;
}

/* Stat cards */
.cc-stat-card {
    background: var(--cc-surface2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
    padding: 1.25rem;
    transition: border-color 0.15s;
}
.cc-stat-card:hover { border-color: var(--cc-primary); }
.cc-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.cc-stat-label {
    font-size: 0.8125rem;
    color: var(--cc-text-muted);
    margin-top: 0.25rem;
}
.cc-stat-icon {
    font-size: 1.5rem;
    opacity: 0.6;
}

/* ── Tables ───────────────────────────────────────────────── */

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cc-text);
    --bs-table-border-color: var(--cc-border);
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    font-size: 0.875rem;
}
.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cc-text-muted);
    font-weight: 600;
    border-top: none;
}

/* ── Forms ────────────────────────────────────────────────── */

.form-control, .form-select {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    color: var(--cc-text);
    border-radius: var(--cc-radius);
}
.form-control:focus, .form-select:focus {
    background: var(--cc-surface);
    border-color: var(--cc-primary);
    color: var(--cc-text);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
}
.form-control::placeholder { color: var(--cc-text-muted); }
.form-label { font-weight: 500; font-size: 0.875rem; margin-bottom: 0.35rem; }

/* ── Buttons ──────────────────────────────────────────────── */

.btn-primary {
    background: var(--cc-primary);
    border-color: var(--cc-primary);
}
.btn-primary:hover {
    background: var(--cc-primary-h);
    border-color: var(--cc-primary-h);
}

/* ── Badges ───────────────────────────────────────────────── */

.badge { font-weight: 500; font-size: 0.75rem; border-radius: 4px; }

/* Compliance colours */
.temp-ok     { color: var(--cc-accent); font-weight: 600; }
.temp-warn   { color: var(--cc-warning); font-weight: 600; }
.temp-danger { color: #f87171; font-weight: 600; }

/* ── Compliance Score Ring ────────────────────────────────── */

.cc-score-ring {
    width: 80px;
    height: 80px;
}
.cc-score-ring circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}
.cc-score-ring .track   { stroke: var(--cc-border); }
.cc-score-ring .fill    { stroke: var(--cc-accent); stroke-dashoffset: 0; transition: stroke-dashoffset 0.6s ease; }
.cc-score-text {
    font-size: 1.1rem;
    font-weight: 700;
    fill: var(--cc-text);
    dominant-baseline: middle;
    text-anchor: middle;
}

/* ── Alerts ───────────────────────────────────────────────── */

.alert {
    border-radius: var(--cc-radius);
    font-size: 0.875rem;
}

/* ── Public pages (login, register) ──────────────────────── */

.cc-public-body {
    min-height: 100vh;
    background: var(--cc-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cc-auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--cc-surface2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.cc-auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.cc-auth-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.cc-register-card {
    max-width: 600px;
}

/* ── Plan Cards (register) ────────────────────────────────── */

.cc-plan-card {
    background: var(--cc-surface);
    border: 2px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    height: 100%;
}
.cc-plan-card:hover         { border-color: var(--cc-primary); }
.cc-plan-card.selected      { border-color: var(--cc-primary); background: rgba(37,99,235,0.1); }
.cc-plan-card .plan-price   { font-size: 1.75rem; font-weight: 700; }
.cc-plan-card .plan-period  { font-size: 0.875rem; color: var(--cc-text-muted); }
.cc-plan-card .plan-badge   { font-size: 0.7rem; }
.cc-plan-features           { list-style: none; padding: 0; margin: 0; font-size: 0.875rem; }
.cc-plan-features li        { padding: 0.25rem 0; color: var(--cc-text-muted); }
.cc-plan-features li::before { content: "✓ "; color: var(--cc-accent); font-weight: 600; }

/* ── Dashboard hub cards ──────────────────────────────────── */

.cc-hub-card {
    background: var(--cc-surface2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--cc-text);
    display: block;
    transition: border-color 0.2s, transform 0.15s;
}
.cc-hub-card:hover {
    border-color: var(--cc-primary);
    transform: translateY(-2px);
    color: var(--cc-text);
}
.cc-hub-card .hub-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    display: block;
}
.cc-hub-card .hub-title  { font-weight: 600; font-size: 0.9375rem; }
.cc-hub-card .hub-desc   { font-size: 0.8125rem; color: var(--cc-text-muted); margin-top: 0.25rem; }
.cc-hub-card .hub-count  { font-size: 1.5rem; font-weight: 700; color: var(--cc-accent); }

/* ── Onboarding / Setup ───────────────────────────────────── */

.cc-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}
.cc-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cc-text-muted);
    font-size: 0.875rem;
}
.cc-step.active   { color: var(--cc-text); }
.cc-step.done     { color: var(--cc-accent); }
.cc-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.cc-step.active .cc-step-num { background: var(--cc-primary); border-color: var(--cc-primary); color: #fff; }
.cc-step.done .cc-step-num   { background: var(--cc-accent); border-color: var(--cc-accent); color: #000; }
.cc-step-line { flex: 1; height: 2px; background: var(--cc-border); min-width: 32px; }

/* ── Subscription trial banner ────────────────────────────── */

.cc-trial-banner {
    background: rgba(37,99,235,0.15);
    border: 1px solid rgba(37,99,235,0.4);
    border-radius: var(--cc-radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ── Staff cards ──────────────────────────────────────────── */

.cc-staff-card {
    background: var(--cc-surface2);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.cc-staff-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--cc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}
.cc-staff-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* ── DDPP Portal ──────────────────────────────────────────── */

.cc-ddpp-badge {
    background: rgba(124,58,237,0.15);
    border: 1px solid rgba(124,58,237,0.4);
    color: #c4b5fd;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.cc-access-code {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    padding: 1rem;
    text-align: center;
    letter-spacing: 0.15em;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .cc-sidebar {
        position: fixed;
        left: -var(--cc-sidebar-w);
        z-index: 1035;
        top: var(--cc-navbar-h);
        height: calc(100vh - var(--cc-navbar-h));
        transition: left 0.25s;
    }
    .cc-sidebar.open { left: 0; }
    .cc-main-content { width: 100%; }
    .cc-org-name { display: none !important; }
    .cc-auth-card { padding: 1.5rem; }
}

/* ── Utilities ────────────────────────────────────────────── */

.text-accent   { color: var(--cc-accent) !important; }
.text-muted    { color: var(--cc-text-muted) !important; }
.bg-surface    { background: var(--cc-surface) !important; }
.bg-surface2   { background: var(--cc-surface2) !important; }
.border-cc     { border-color: var(--cc-border) !important; }
.rounded-cc    { border-radius: var(--cc-radius) !important; }
.fw-semi       { font-weight: 600 !important; }

.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
