[hidden] { display: none !important; }

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    margin: 0;
    padding: 1.5rem;
    color: #1a1a1a;
    background: #f7f7f8;
    padding-bottom: 6rem;
}

h1 { font-size: 1.25rem; margin-top: 1rem; }
h2 { font-size: 1.1rem; margin-top: 2rem; }

/* ---------- Vues ---------- */
.view { min-height: 100vh; }
#error-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}
.login-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    max-width: 420px;
    width: 100%;
}
.login-card h1 { margin-top: 0; font-size: 1.3rem; }
.login-card p { color: #555; font-size: .9rem; margin-bottom: 1.2rem; }

/* ---------- En-tête ---------- */
.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1.1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 1rem;
    font-size: .9rem;
    flex-wrap: wrap;
}
.user-info { display: flex; align-items: center; gap: .6rem; }

.total-contacts {
    font-size: .82rem;
    color: #4b5563;
    padding: .3rem .7rem;
    background: #f3f4f6;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.color-legend {
    display: flex;
    gap: 1rem;
    font-size: .78rem;
    color: #6b7280;
    align-items: center;
    margin-left: auto;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
}
.dot-own   { background: #ffffff; }
.dot-other { background: #e2e8f0; }

.user-quota {
    color: #4b5563;
    font-size: .85rem;
    display: flex;
    gap: 1rem;
    white-space: nowrap;
}

.badge {
    background: #eff6ff;
    color: #1d4ed8;
    padding: .2rem .55rem;
    border-radius: 20px;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
}

/* ---------- Bannière ---------- */
.warning-banner {
    background: #fff4e5;
    border-left: 4px solid #f59e0b;
    padding: .9rem 1.1rem;
    margin-bottom: 1.2rem;
    border-radius: 6px;
    font-size: .9rem;
    color: #7c2d12;
}

/* ---------- Recherche ---------- */
.search-bar { margin: 1.2rem 0; }
#search-input {
    width: 100%;
    padding: .75rem 1rem;
    font-size: .95rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
#search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
#search-summary {
    font-size: .85rem;
    color: #4b5563;
    margin-bottom: .8rem;
    padding: .5rem .8rem;
    background: #eff6ff;
    border-left: 3px solid #2563eb;
    border-radius: 4px;
}

/* ---------- Tableau ---------- */
#loading { color: #666; padding: 1rem 0; }
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
th, td {
    padding: .65rem .75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: .9rem;
}
th { background: #fafafa; font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Ligne contact "autre" : fond légèrement gris */
tr.row-other-contact {
    background-color: #e2e8f0;
}
tr.row-other-contact:hover {
    background-color: #d7dfe8;
}

/* ---------- Barre fixe ---------- */
.sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: .8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
    z-index: 100;
}
.sticky-info { font-size: .9rem; color: #4b5563; }
.sticky-info.warning { color: #dc2626; font-weight: 600; }

button#import-btn {
    padding: .6rem 1.1rem;
    font-size: .9rem;
    border: none;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}
button#import-btn:disabled { background: #c7d2fe; cursor: not-allowed; }

/* ---------- Statut scroll ---------- */
#scroll-status {
    text-align: center;
    color: #9ca3af;
    font-size: .85rem;
    padding: 1rem 0;
}

/* ---------- Checkboxes ---------- */
.record-checkbox:disabled { opacity: .35; cursor: not-allowed; }

#result {
    margin-top: 1rem;
    font-size: .9rem;
    padding: .5rem;
    text-align: center;
    color: #4b5563;
}