/* ============================================================
   PROJECT MANAGER — app.css
   Thème : sobre gris/blanc professionnel
   ============================================================ */

/* --- Variables -------------------------------------------- */
:root {
    --color-bg:           #f5f6f8;
    --color-surface:      #ffffff;
    --color-surface-2:    #f0f1f4;
    --color-border:       #e2e4e9;
    --color-border-light: #eceef2;

    --color-text:         #1a1d23;
    --color-text-muted:   #6b7280;
    --color-text-light:   #9ca3af;

    --color-primary:      #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-soft: #eff6ff;

    --color-success:      #16a34a;
    --color-success-soft: #f0fdf4;
    --color-error:        #dc2626;
    --color-error-soft:   #fef2f2;
    --color-warning:      #d97706;
    --color-warning-soft: #fffbeb;

    --color-stat-blue:    #2563eb;
    --color-stat-green:   #16a34a;
    --color-stat-orange:  #ea580c;
    --color-stat-purple:  #7c3aed;

    --font-main:  'DM Sans', system-ui, sans-serif;
    --font-mono:  'DM Mono', monospace;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg:  0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.04);

    --navbar-h:   60px;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   NAVBAR
   ============================================================ */
.pm-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 32px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.pm-navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    text-decoration: none;
}
.pm-navbar-brand i {
    font-size: 20px;
    color: var(--color-primary);
}

.pm-navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex: 1;
}
.pm-navbar-nav a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: background .15s, color .15s;
    text-decoration: none;
}
.pm-navbar-nav a:hover { background: var(--color-surface-2); color: var(--color-text); }
.pm-navbar-nav a.active { background: var(--color-primary-soft); color: var(--color-primary); }

.pm-navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.pm-username {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pm-btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: background .15s, color .15s;
    font-size: 16px;
    text-decoration: none;
}
.pm-btn-logout:hover { background: var(--color-error-soft); color: var(--color-error); text-decoration: none; }

/* Badges rôle */
.pm-badge-role {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-family: var(--font-mono);
}
.pm-badge-admin   { background: #ede9fe; color: #6d28d9; }
.pm-badge-manager { background: #dbeafe; color: #1d4ed8; }
.pm-badge-user    { background: #dbeafe; color: #1d4ed8; }
.pm-badge-viewer  { background: var(--color-surface-2); color: var(--color-text-muted); }

.pm-auth-provider {
    font-size: 12px;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.pm-layout {
    margin-top: var(--navbar-h);
    min-height: calc(100vh - var(--navbar-h));
}

.pm-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 32px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.pm-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
}
.pm-page-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.pm-page-header h2 i { color: var(--color-primary); }
.pm-subtitle {
    color: var(--color-text-muted);
    margin-top: 4px;
    font-size: 13.5px;
}
.pm-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ============================================================
   ALERTES / FLASH
   ============================================================ */
.pm-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 24px;
    border: 1px solid transparent;
}
.pm-alert i { font-size: 16px; flex-shrink: 0; }
.pm-alert-error   { background: var(--color-error-soft);   color: var(--color-error);   border-color: #fecaca; }
.pm-alert-success { background: var(--color-success-soft); color: var(--color-success); border-color: #bbf7d0; }
.pm-alert-warning { background: var(--color-warning-soft); color: var(--color-warning); border-color: #fde68a; }

/* ============================================================
   STATS GRID (dashboard)
   ============================================================ */
.pm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.pm-stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.pm-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pm-stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.pm-stat-blue   { background: #dbeafe; color: var(--color-stat-blue); }
.pm-stat-green  { background: #dcfce7; color: var(--color-stat-green); }
.pm-stat-orange { background: #ffedd5; color: var(--color-stat-orange); }
.pm-stat-purple { background: #ede9fe; color: var(--color-stat-purple); }
.pm-stat-body { display: flex; flex-direction: column; gap: 2px; }
.pm-stat-number { font-size: 24px; font-weight: 700; line-height: 1; font-family: var(--font-mono); }
.pm-stat-label  { font-size: 12px; color: var(--color-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.pm-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}
.pm-empty-state i {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    color: var(--color-border);
}

/* ============================================================
   FORMULAIRES
   ============================================================ */
.pm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}
.pm-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pm-field label i { color: var(--color-text-muted); }

.pm-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.pm-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.pm-input::placeholder { color: var(--color-text-light); }

.pm-input-group {
    position: relative;
    display: flex;
}
.pm-input-group .pm-input { padding-right: 44px; }
.pm-input-toggle {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.pm-input-toggle:hover { color: var(--color-text); }

/* ============================================================
   BOUTONS
   ============================================================ */
.pm-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s, box-shadow .15s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
}
.pm-btn:active { transform: translateY(1px); }

.pm-btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.pm-btn-primary:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 4px 12px rgba(37,99,235,.25);
    text-decoration: none;
    color: #fff;
}

.pm-btn-outline {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}
.pm-btn-outline:hover { background: var(--color-surface-2); text-decoration: none; color: var(--color-text); }

.pm-btn-full { width: 100%; justify-content: center; }

/* ============================================================
   PAGE LOGIN
   ============================================================ */
.pm-login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(37,99,235,.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(37,99,235,.04) 0%, transparent 50%);
}

.pm-login-wrap {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.pm-login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}

.pm-login-brand {
    text-align: center;
    margin-bottom: 32px;
}
.pm-login-icon {
    width: 56px; height: 56px;
    background: var(--color-primary-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--color-primary);
    margin: 0 auto 16px;
    border: 1.5px solid #bfdbfe;
}
.pm-login-brand h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}
.pm-login-brand p {
    font-size: 13px;
    color: var(--color-text-muted);
}

.pm-login-form { margin-top: 8px; }

.pm-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--color-text-muted);
    font-size: 12px;
}
.pm-login-divider::before,
.pm-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.pm-btn-ms {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: #ffffff;
    color: #3c3c3c;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.pm-btn-ms:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pm-login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--color-text-light);
    font-size: 12px;
}
.pm-login-footer i { margin-right: 4px; }

/* ============================================================
   STAT CARD — lien cliquable
   ============================================================ */
a.pm-stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.pm-stat-card-link:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
    border-color: var(--color-primary);
}

/* ============================================================
   FILTRES
   ============================================================ */
.pm-filter-bar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 16px;
}
.pm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pm-filter-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
}
.pm-input-sm {
    padding: 5px 10px;
    font-size: 13px;
    height: 32px;
}
.pm-btn-reset { color: var(--color-text-muted); }

/* Tri colonnes */
.pm-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.pm-sort-link:hover { color: var(--color-primary); }
.pm-sort-neutral { opacity: .35; font-size: 11px; }
.pm-sort-active  { color: var(--color-primary); font-size: 12px; }

/* ============================================================
   TABLE
   ============================================================ */
.pm-table-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.pm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.pm-table thead {
    background: var(--color-surface-2);
    border-bottom: 1px solid var(--color-border);
}

.pm-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.pm-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.pm-table tbody tr:last-child td {
    border-bottom: none;
}

.pm-table tbody tr:hover td {
    background: var(--color-surface-2);
}

.pm-col-num { text-align: right; }
.pm-col-name { max-width: 320px; }

.pm-mono { font-family: var(--font-mono); font-size: 12.5px; }
.pm-text-muted { color: var(--color-text-muted); }
.pm-num-value { font-family: var(--font-mono); font-weight: 600; }

.pm-badge-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    white-space: nowrap;
}

/* ============================================================
   BADGES STATUT
   ============================================================ */
.pm-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .02em;
}
.pm-status-nofiles  { background: #f1f5f9; color: #64748b; }
.pm-status-pruefung { background: #dbeafe; color: #1d4ed8; }
.pm-status-beendet  { background: #dcfce7; color: #15803d; }
.pm-status-lf       { background: #ffedd5; color: #c2410c; }
.pm-status-bfe      { background: #ede9fe; color: #6d28d9; }

/* Badge responsable */
.pm-badge-resp {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--color-surface-2);
    color: var(--color-text);
    font-family: var(--font-mono);
    letter-spacing: .04em;
}

/* Formulaires d'action (statut + responsable) sur la page détail */
.pm-detail-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.pm-status-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pm-action-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pm-status-select {
    width: auto;
    padding: 7px 10px;
    font-size: 13px;
}
.pm-btn-sm {
    padding: 7px 12px;
    font-size: 13px;
}

/* ============================================================
   MODAL (overlay custom)
   ============================================================ */
.pm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.pm-overlay.pm-overlay-visible {
    display: flex;
}
.pm-modal-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-main);
    width: 100%;
    max-width: 480px;
    margin: 16px;
}
.pm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    padding: 18px 24px;
    font-size: 15px;
    font-weight: 600;
    gap: 10px;
}
.pm-modal-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}
.pm-modal-header i { color: var(--color-primary); }
.pm-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0 2px;
}
.pm-modal-close:hover { color: var(--color-text); }
.pm-modal-body { padding: 24px; }
.pm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--color-border);
    padding: 16px 24px;
}
.pm-modal-desc {
    font-size: 13.5px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ============================================================
   BOUTON ICÔNE
   ============================================================ */
.pm-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 15px;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.pm-btn-icon:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    text-decoration: none;
}

/* ============================================================
   PAGE DÉTAIL
   ============================================================ */
.pm-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    text-decoration: none;
    transition: color .15s;
}
.pm-back-link:hover { color: var(--color-primary); text-decoration: none; }

.pm-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.pm-detail-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
}

.pm-detail-section-wide {
    grid-column: 1 / -1;
}

.pm-detail-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.pm-detail-section-title i { font-size: 14px; color: var(--color-primary); }

.pm-detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: 13.5px;
}
.pm-detail-list dt {
    color: var(--color-text-muted);
    font-weight: 500;
    white-space: nowrap;
    padding-top: 1px;
}
.pm-detail-list dd {
    color: var(--color-text);
    word-break: break-word;
}

.pm-detail-yes { color: var(--color-success); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.pm-detail-no  { color: var(--color-text-light); display: inline-flex; align-items: center; gap: 5px; }

/* Textarea commentaires */
.pm-textarea {
    width: 100%;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}
.pm-textarea-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* Commentaires ligne par ligne */
.pm-comments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.pm-comments-empty {
    font-size: 0.875rem;
    margin-bottom: 12px;
}
.pm-comment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-bg-subtle, #f8f9fa);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
}
.pm-comment-text {
    flex: 1;
    line-height: 1.5;
    word-break: break-word;
}
.pm-comment-delete-btn {
    flex-shrink: 0;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--color-error);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}
.pm-comment-delete-btn:hover {
    background: var(--color-error-soft);
}
.pm-comment-add-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pm-comment-input {
    flex: 1;
}

/* Section fournisseur & mesures liées */
.pm-linked-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 24px;
    margin-top: 28px;
}
.pm-linked-lieferant {
    margin-bottom: 4px;
}
.pm-detail-list-horiz {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 32px;
}
.pm-detail-list-horiz dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    margin-bottom: 0;
}
.pm-detail-list-horiz dd {
    font-weight: 500;
    margin-bottom: 8px;
}
.pm-row-current td {
    background: var(--color-primary-soft);
    font-weight: 600;
}
.pm-link {
    color: var(--color-primary);
    text-decoration: none;
}
.pm-link:hover { text-decoration: underline; }
.pm-summary-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 20px;
    align-items: baseline;
    background: var(--color-surface-2);
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 4px;
}
.pm-summary-list dt {
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pm-summary-list dd {
    font-weight: 600;
    font-size: 14px;
}
.pm-ratio-ok  { color: #15803d; }
.pm-ratio-nok { color: #c2410c; }

/* Formulaire inline dans les dd du détail (économies validées) */
.pm-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pm-input-num {
    width: 120px;
    text-align: right;
}
.pm-input-unit {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ============================================================
   SECTION FICHIERS
   ============================================================ */
.pm-files-section {
    margin-top: 28px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
}

.pm-files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 16px;
    flex-wrap: wrap;
}

.pm-files-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 20px;
    background: var(--color-surface-2);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-left: 6px;
}

.pm-upload-form { display: flex; align-items: center; gap: 8px; }
.pm-upload-label { cursor: pointer; position: relative; }
.pm-upload-input {
    position: absolute;
    width: 0; height: 0;
    opacity: 0;
    pointer-events: none;
}

.pm-files-empty {
    color: var(--color-text-muted);
    font-size: 13.5px;
    padding: 12px 0;
}

.pm-files-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pm-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    transition: background .15s;
}
.pm-file-item:hover { background: #e9edf5; }

.pm-file-icon {
    font-size: 22px;
    flex-shrink: 0;
    color: var(--color-primary);
}

.pm-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pm-file-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pm-file-name:hover { color: var(--color-primary); text-decoration: underline; }

.pm-file-meta {
    font-size: 11.5px;
    color: var(--color-text-muted);
}

.pm-btn-icon-danger { color: var(--color-text-muted); }
.pm-btn-icon-danger:hover { background: var(--color-error-soft); color: var(--color-error); }

/* Bouton danger */
.pm-btn-danger {
    background: #dc2626;
    color: #fff;
    border: 1px solid #dc2626;
}
.pm-btn-danger:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; }
.pm-btn-danger:disabled { opacity: .45; cursor: not-allowed; }

/* Modale suppression */
.pm-modal-danger .pm-modal-header { border-bottom-color: #fecaca; background: #fff5f5; }
.pm-icon-danger { color: #dc2626 !important; }
.pm-delete-warning {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 18px;
}
.pm-delete-warning > i {
    font-size: 28px;
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 2px;
}
.pm-delete-warning strong { display: block; margin-bottom: 6px; color: #991b1b; }
.pm-delete-warning p { margin: 0 0 6px; font-size: 13.5px; color: #374151; }
.pm-delete-warning p:last-child { margin-bottom: 0; }
.pm-delete-confirm-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .pm-main { padding: 24px 16px; }
    .pm-navbar { padding: 0 16px; gap: 16px; }
    .pm-navbar-nav { display: none; }
    .pm-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .pm-login-card { padding: 28px 20px; }
}
