/* ── Page header ───────────────────────────────────────────── */
.page-header {
    background: linear-gradient(135deg, var(--arch-blue) 0%, var(--arch-blue-mid) 100%);
    border-radius: 14px;
    padding: 20px 26px;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(30, 111, 217, 0.22);
}
.header-icon {
    font-size: 2rem;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 10px 14px;
    line-height: 1;
    flex-shrink: 0;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-header p  { margin: 3px 0 0; opacity: 0.8; font-size: 0.84rem; }
.header-stats   { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stat-pill {
    background: rgba(255,255,255,0.18);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ── API bar ───────────────────────────────────────────────── */
.api-bar {
    background: #fff;
    border-radius: 10px;
    padding: 9px 18px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.86rem;
    flex-wrap: wrap;
}
.status-dot {
    width: 9px; height: 9px; border-radius: 50%;
    display: inline-block; margin-right: 4px;
}
.status-dot.online  { background: #16a34a; box-shadow: 0 0 0 3px #bbf7d0; }
.status-dot.offline { background: #dc2626; box-shadow: 0 0 0 3px #fecaca; }
.status-dot.pending { background: #f59e0b; box-shadow: 0 0 0 3px #fde68a; }
.btn-refresh {
    margin-left: auto;
    background: #f1f5f9; border: none; border-radius: 7px;
    padding: 5px 13px; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; color: #475569;
    transition: background 0.18s;
    display: flex; align-items: center; gap: 5px;
}
.btn-refresh:hover { background: #e2e8f0; }

/* ── List card ─────────────────────────────────────────────── */
.list-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    overflow: hidden;
    margin-bottom: 24px;
}
.list-card-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}
.list-card-header.wl-header { background: linear-gradient(135deg, #0d5c30, #16a34a); }
.list-card-header.bl-header { background: linear-gradient(135deg, #7f1d1d, #dc2626); }
.list-card-header h5 {
    color: #fff; margin: 0; font-weight: 700; font-size: 0.97rem;
    display: flex; align-items: center; gap: 8px;
}
.count-badge {
    background: rgba(255,255,255,0.24); color: #fff;
    border-radius: 20px; padding: 2px 10px;
    font-size: 0.76rem; font-weight: 700;
}

/* ── Add form ──────────────────────────────────────────────── */
.add-form {
    padding: 16px 18px 18px;
    background: #f8fafd;
    border-bottom: 1px solid #eef1f6;
}
.add-form-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
@media (max-width: 768px) { .form-row-2 { grid-template-columns: 1fr; } }

.field-group { margin-bottom: 10px; }
.field-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    margin-bottom: 5px;
}
.field-input {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #dde3ed;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    font-family: inherit;
}
.field-input:focus {
    outline: none;
    border-color: var(--arch-blue-mid);
    box-shadow: 0 0 0 3px rgba(46,139,239,0.12);
}
.field-select { cursor: pointer; }

/* ── Dynamic phone inputs ──────────────────────────────────── */
.phones-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.phone-entry { display: flex; gap: 0; }
.phone-entry .field-input {
    border-radius: 8px 0 0 8px;
    border-right: none;
    flex: 1;
}
.phone-entry .field-input:focus { border-color: var(--arch-blue-mid); }
.btn-rm-phone {
    width: 36px; flex-shrink: 0;
    background: #fee2e2; color: #dc2626;
    border: 2px solid #fecaca; border-radius: 0 8px 8px 0;
    cursor: pointer; font-size: 0.9rem;
    transition: background 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.btn-rm-phone:hover { background: #fecaca; }
.btn-add-phone {
    font-size: 0.78rem; font-weight: 600; color: var(--arch-blue);
    background: none; border: none; padding: 3px 0;
    cursor: pointer; display: flex; align-items: center; gap: 3px;
    transition: opacity 0.18s;
}
.btn-add-phone:hover { opacity: 0.7; }

/* ── Services checkboxes ───────────────────────────────────── */
.services-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.svc-check {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}
.svc-check input[type="checkbox"] { display: none; }
.svc-check span {
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 2px solid #dde3ed;
    background: #fff;
    color: #64748b;
    transition: all 0.18s;
    display: flex; align-items: center; gap: 5px;
    user-select: none;
}
.svc-check input:checked + span {
    background: var(--arch-blue-mid);
    border-color: var(--arch-blue-mid);
    color: #fff;
}
.svc-check:hover span { border-color: var(--arch-blue-mid); color: var(--arch-blue); }

/* ── Submit button ─────────────────────────────────────────── */
.btn-submit {
    width: 100%; padding: 10px;
    border: none; border-radius: 9px;
    color: #fff; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; margin-top: 10px;
    transition: opacity 0.2s, transform 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-submit:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }
.btn-submit-wl { background: linear-gradient(135deg, #0d5c30, #16a34a); }
.btn-submit-bl { background: linear-gradient(135deg, #7f1d1d, #dc2626); }

/* ── List body ─────────────────────────────────────────────── */
.list-body { padding: 13px 16px; }
.search-field {
    width: 100%; padding: 8px 12px;
    border: 2px solid #dde3ed; border-radius: 8px;
    font-size: 0.86rem; margin-bottom: 11px;
    transition: border-color 0.18s;
}
.search-field:focus { outline: none; border-color: var(--arch-blue-mid); }

/* ── Entry card ────────────────────────────────────────────── */
.entry-card {
    border-radius: 11px;
    margin-bottom: 8px;
    overflow: hidden;
    animation: fadeSlide 0.2s ease;
    transition: box-shadow 0.18s;
}
.entry-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); }
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}
.entry-card.wl-card { border-left: 4px solid #16a34a; background: #f0fdf4; }
.entry-card.bl-card { border-left: 4px solid #dc2626; background: #fff5f5; }

/* Entry header row */
.entry-head {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 10px 12px 6px;
}
.entry-identity { display: flex; align-items: center; gap: 10px; }
.entry-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.entry-avatar.wl { background: #dcfce7; color: #16a34a; }
.entry-avatar.bl { background: #fee2e2; color: #dc2626; }
.entry-name { font-weight: 700; font-size: 0.92rem; color: #1e293b; }

/* Status badge */
.status-badge {
    display: inline-block;
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    padding: 2px 8px; border-radius: 20px; margin-top: 2px;
}
.status-badge.active    { background: #dcfce7; color: #16a34a; }
.status-badge.inactive  { background: #f1f5f9; color: #64748b; }
.status-badge.pending   { background: #fef9c3; color: #854d0e; }
.status-badge.suspended { background: #fee2e2; color: #dc2626; }

/* Actions */
.entry-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-move, .btn-del {
    border: none; border-radius: 6px;
    padding: 4px 9px; font-size: 0.74rem; font-weight: 600;
    cursor: pointer; transition: opacity 0.18s;
    display: flex; align-items: center; gap: 3px;
}
.btn-move:hover, .btn-del:hover { opacity: 0.68; }
.btn-to-bl { background: #fee2e2; color: #dc2626; }
.btn-to-wl { background: #dcfce7; color: #16a34a; }
.btn-del   { background: #f1f5f9; color: #64748b; }

/* Entry detail rows */
.entry-phones {
    padding: 0 12px 6px;
    font-size: 0.82rem; color: #475569;
    display: flex; flex-wrap: wrap; gap: 6px;
}
.phone-chip {
    background: rgba(255,255,255,0.7);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 0.8rem; color: #334155;
    display: inline-flex; align-items: center; gap: 4px;
}

.entry-services {
    padding: 0 12px 8px;
    display: flex; flex-wrap: wrap; gap: 5px;
}
.svc-tag {
    font-size: 0.72rem; font-weight: 600;
    padding: 2px 9px; border-radius: 20px;
    background: rgba(46,139,239,0.12); color: var(--arch-blue);
    border: 1px solid rgba(46,139,239,0.25);
}

.entry-reason {
    padding: 0 12px 10px;
    font-size: 0.8rem; color: #b45309;
    display: flex; align-items: flex-start; gap: 5px;
}
.entry-reason i { flex-shrink: 0; margin-top: 1px; }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 28px 16px;
    color: #94a3b8; font-size: 0.88rem;
}
.empty-state i { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container { z-index: 9999; }
.toast { border-radius: 10px; font-size: 0.86rem; }
