/* ============================================================
   Dashboard.css — Tableau de bord : stats + publications
   ============================================================ */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.stat-icon.blue  { background: rgba(46,134,193,.12);  color: var(--blue);    }
.stat-icon.gold  { background: rgba(232,184,75,.15);  color: var(--gold);    }
.stat-icon.green { background: rgba(46,204,113,.12);  color: var(--success); }
.stat-icon.red   { background: rgba(231,76,60,.1);    color: var(--danger);  }

.stat-val   { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ── Fil de publications ────────────────────────────────────── */
.feed-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.feed-title i { color: var(--blue); }

/* Fil en colonne unique — les images faisant au maximum 400px de large, 500px de large pour la
   carte laisse une marge de lecture confortable sans gaspiller d'espace horizontal. */
.feed-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Tableau de bord : fil + colonne d'informations ────────────── */
.dashboard-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}
.dashboard-main {
    width: 500px;
    max-width: 100%;
    flex-shrink: 0;
}
.dashboard-sidebar,
.dashboard-features {
    flex: 1 1 240px;
    min-width: 240px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.widget { padding: 14px 16px; }
.widget-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin: 0 0 10px;
}
.widget .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.widget .stat-mini {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.widget .stat-mini .n { font-size: 18px; font-weight: 700; line-height: 1.1; color: var(--navy); }
.widget .stat-mini .l { font-size: 10.5px; color: var(--text-muted); }
.widget .row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    cursor: pointer;
}
.widget .row:last-child { border-bottom: none; }
.widget .badge-grp {
    font-size: 10px;
    background: var(--bg);
    border-radius: 20px;
    padding: 1px 7px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Actions "Déclarer" du tableau de bord société ────────────── */
.declare-actions-full   { display: inline-flex; gap: 0.5rem; }
.declare-actions-mobile { display: none; position: relative; }

/* ── Tableau de bord société ────────────────────────────────── */
.company-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.company-dashboard-identity { min-width: 260px; }
.company-dashboard-identity h1 { margin: 0 0 4px; }
.company-registration-code { margin-top: 8px !important; color: var(--text) !important; }
.company-dashboard-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 720px;
}
.company-dashboard-actions .btn {
    min-height: 36px;
    padding-inline: 15px;
    border-color: rgba(46,134,193,.55);
    color: #1769a6;
    background: #fff;
}
.company-dashboard-actions .btn:hover { background: #eef7fd; border-color: var(--blue); }
.company-declare-actions { position: relative; }
.company-declare-actions .dropdown {
    left: auto;
    right: 0;
    min-width: 235px;
    max-width: calc(100vw - 32px);
}

/* ── Tableau de bord personnel ─────────────────────────────── */
.personal-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.personal-dashboard-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.personal-dashboard-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), #1769a6);
    box-shadow: 0 4px 12px rgba(46,134,193,.22);
}
.personal-dashboard-identity h1 { margin: 0 0 3px; }
.personal-dashboard-identity p { margin: 0; }
.personal-dashboard-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: var(--bg);
    font-size: 12.5px;
    text-transform: capitalize;
    white-space: nowrap;
}
.personal-dashboard-date i { color: var(--blue); }
.personal-dashboard-sidebar .widget-title {
    color: var(--navy);
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}
.personal-dashboard-sidebar .widget-title i {
    width: 18px;
    color: var(--blue);
    text-align: center;
}

.dashboard-priority-panel {
    margin-bottom: 20px;
    overflow: hidden;
    color: #6e4b00;
    background: linear-gradient(90deg, #fffaf0, #fff7e7);
    border: 1px solid #e8ad29;
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(232,184,75,.12);
}
.dashboard-priority-panel h2 {
    margin: 0 20px;
    padding: 12px 0 9px;
    border-bottom: 1px solid rgba(187,126,0,.3);
    color: #bf7c00;
    font-size: 16px;
    font-weight: 700;
}
.dashboard-priority-panel h2 i { margin-right: 8px; }
.dashboard-priority-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-priority-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 10px 20px;
}
.dashboard-priority-item + .dashboard-priority-item { border-left: 1px solid rgba(187,126,0,.3); }
.dashboard-priority-item > i { color: #d28a00; }
.dashboard-priority-item span { font-size: 12.5px; line-height: 1.35; }
.dashboard-priority-item .btn-warning {
    border: 0;
    color: #fff;
    background: #df9500;
    box-shadow: 0 2px 7px rgba(194,125,0,.2);
    white-space: nowrap;
}
.dashboard-priority-item .btn-warning:hover { color: #fff; background: #c98200; }

.company-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(290px, .9fr);
    align-items: start;
    gap: 20px;
    margin-bottom: 20px;
}
.company-dashboard-feed {
    min-width: 0;
    padding: 16px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(214,224,234,.8);
    border-radius: var(--radius);
}
.company-dashboard-feed .feed-title { margin-bottom: 12px; font-size: 16px; }
.company-dashboard-feed .feed-title > i { display: none; }
.company-dashboard-sidebar { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.company-dashboard-sidebar .widget { padding: 15px 17px; }
.company-dashboard-sidebar .widget-title {
    margin-bottom: 11px;
    color: var(--navy);
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}
.dashboard-overview .stat-grid { gap: 0; }
.dashboard-overview .stat-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 68px;
    padding: 10px 12px;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}
.dashboard-overview .stat-mini:nth-child(odd) { border-right: 1px solid var(--border); }
.dashboard-overview .stat-mini:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
.stat-mini-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    border-radius: 50%;
    color: var(--blue);
    background: #e6f2fc;
    font-size: 15px;
}
.dashboard-overview .stat-mini .n { font-size: 20px; }
.dashboard-overview .stat-mini .l { font-size: 11px; }
.dashboard-action-widget .row { min-height: 42px; }

/* ── Fonctionnalités, en onglets sur le tableau société ────── */
.features-empty { margin: 0; color: var(--text-muted); font-size: 12.5px; }
.features-showcase { margin-bottom: 20px; padding: 0 20px 16px; overflow: hidden; }
.features-showcase-header {
    display: flex;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid var(--border);
}
.features-showcase-header h2 {
    margin: 0;
    padding: 15px 0;
    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}
.features-tabs { display: flex; align-self: stretch; }
.features-tabs .tab-btn { padding: 14px 22px; }
.features-items-horizontal {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 12px;
}
.feature-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 8px 18px;
    border: 0;
    border-right: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.feature-tile:nth-child(3n) { border-right: 0; }
.feature-tile:disabled { opacity: 1; cursor: default; }
.feature-tile:hover:not(:disabled) { background: var(--bg); }
.feature-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), #1769a6);
}
.feature-tile-copy { min-width: 0; flex: 1; }
.feature-tile-copy strong { display: block; overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.feature-tile-copy small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.feature-tile-arrow { color: var(--text-muted); font-size: 10px; }
.features-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 70px;
    color: var(--text-muted);
    font-size: 12.5px;
}
.features-load-more { display: block; margin: 12px auto 0; }

.dashboard-visios { margin-bottom: 20px; padding: 16px 20px; }
.dashboard-visios h2 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.dashboard-visios h2 i { margin-right: 7px; color: var(--blue); }
.dashboard-visios-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; }
.dashboard-visio-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.dashboard-visio-row:hover { background: var(--bg); }
.dashboard-visio-row span { text-transform: capitalize; }
.dashboard-visio-row small { color: var(--text-muted); white-space: nowrap; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .company-dashboard-header { flex-direction: column; }
    .company-dashboard-actions { justify-content: flex-start; max-width: none; }
    .company-declare-actions .dropdown { left: 0; right: auto; }
}
@media (max-width: 900px) {
    .dashboard-main { width: 100%; }
    .company-dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-priority-items { grid-template-columns: 1fr; }
    .dashboard-priority-item + .dashboard-priority-item { border-top: 1px solid rgba(187,126,0,.3); border-left: 0; }
    .features-showcase-header { align-items: flex-start; flex-direction: column; gap: 0; }
    .features-tabs { width: 100%; overflow-x: auto; }
    .features-items-horizontal { grid-template-columns: 1fr 1fr; }
    .feature-tile:nth-child(3n) { border-right: 1px solid var(--border); }
    .feature-tile:nth-child(2n) { border-right: 0; }
}
@media (max-width: 768px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card  { padding: 12px; }
    .stat-val   { font-size: 18px; }
    .declare-actions-full   { display: none; }
    .declare-actions-mobile { display: inline-block; }
    .company-dashboard-header { padding: 16px; }
    .personal-dashboard-header { align-items: flex-start; flex-direction: column; padding: 16px; }
    .personal-dashboard-date { width: 100%; }
    .company-dashboard-actions { width: 100%; }
    .company-dashboard-actions .btn { flex: 1 1 145px; justify-content: center; }
    .company-declare-actions { flex: 1 1 145px; }
    .company-declare-actions > .btn { width: 100%; }
    .dashboard-priority-item { grid-template-columns: auto 1fr; }
    .dashboard-priority-item .btn { grid-column: 2; justify-self: start; }
    .features-showcase { padding-inline: 14px; }
    .features-items-horizontal, .dashboard-visios-grid { grid-template-columns: 1fr; }
    .feature-tile { border-right: 0 !important; border-bottom: 1px solid var(--border); }
}
@media (max-width: 400px) {
    .stats-row { grid-template-columns: 1fr; }
}
